Access to Pinterest API while app is pending

58 views Asked by At

So, I signed up for a Pinterest business account, and created an app. My app is still pending, but per the developer page, I generated an access token to "Use this token to test and explore our v5 API".

But when I tried to access the API, I get an error:

{"code":3,"message":"Authorization failed."}

Shouldn't the access token I got from the app page work? The page says I get access to pins:read, boards:read and user_accounts:read scopes. My code looks like:

$ch = curl_init("https://api.pinterest.com/v5/boards");
curl_setopt($ch, CURLOPT_HTTPGET, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$request_headers = [
    "Authorization: Bearer <MY ACCESS TOKEN>",
    "Content-Type: application/json"
];
curl_setopt($ch, CURLOPT_HTTPHEADER,$request_headers );

$response = curl_exec($ch);

if (curl_errno($ch)) 
{
    print "Error: " . curl_error($ch) . "\n";
} 
else 
{
    print "RESPONSE: $response\n";
}

// Close the cURL handle
curl_close($ch);
0

There are 0 answers