NEW API - Problem in very simple request.


I’m trying to create with the new API a simple call that returns some user information as shown in the official documentation here

My problem is the call CURL and do not know what I’m doing wrong, I create a php file with this code ( I have already got the access token after executing the authentication ):


$n_access_token = "xxxxxxxxxxxxxxxxx";

//prepare parameters
$url = '';
$headers = 'Authorization: Bearer '.$n_access_token;

$ch = curl_init();

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_URL, $url);




The page shows me this:

{"error":"access_denied","error_description":"Bearer token not found"}

Please Help me

CURLOPT_HTTPHEADER accepts an array, with each element in the array being a single header, so it should be:

$headers = array('Authorization: Bearer '.$n_access_token);

Thanks for the reply :slight_smile: but now I see this message:

{“error”:"Scopes not matching. Expected [“user:account”] ",“code”:“not_authenticated”}

this is strange because I just ran the authentication, any ideas?


Afraid not on this one as I’ve never used the Envato API :frowning: Hopefully someone else who’s used it can assist!

Ensure all permissions are ticked on your token settings

Thanks ! Now it works !! :grinning:

1 Like