Is Envato API working ?

Hello everyone,

I’m trying to run few API codes, but i got NULL responds from the server side.

I also checked Envato API website, and it’s not working, is that just on my side or do you also face the same issue?

https://api.envato.com/

The same thing. But my app getting response “internal server error”.
And that what i see when try to get response via https://build.envato.com/api/


All in all I created a ticket and waiting for response from envato help team.

Hey @DoughouzForest,

Are you able to provide a little more information about the failures you are seeing? Things like which endpoints you are using, personal token/oauth, sample code, etc. will help us diagnose it faster.

Hiya @TeamMoore,

We identified a regression introduced at 14:56 AEST that impacted the API search endpoints and resulted in empty results being returned. This issue was rectified at 16:15 AEST and the search endpoints are now working as intended from my tests. Can you please confirm this is the same for you?

Thank you, problem fixed. By the way i faced with this problem in last week wore than 5 times. Couple times it’s last more than 48 hours.

Yep - this sounds about correct. To run these services securely, we heavily network segment to limit what resources they each have access to. Much of this can be altered during our deployment cycle and unfortunately here the access roles were flapping back and forth causing intermittent failures to connect. The permission flapping issue is something I’ve temporarily patched and will be taking further steps in the coming days to ensure we get on top of entirely.

Thanks for getting back @jacobbednarz,

The API request “list-purchases” is not working at all.

It was working fine on my script, i can get the access_code normaly, but when it run:

https://api.envato.com/v3/market/buyer/list-purchases?access_token=H4P5B9fS3WlA4rNWIXfvrVBXHEyiEZma

I get:

 {"message":"Unauthorized"}

I didn’t touch my code at all, I was using the script around 3 months from now, but from yesterday i face this issue. Any ideas?

Also, i tried many access keys, but no chance.

Also, so many API applications such as nWallet are not working too.

@jacobbednarz

Here is my code if you like to check:

SECRET_KEY = My APP secret key.

$url  = 'https://api.envato.com/token';
$myvars = 'grant_type=authorization_code&code=' . $_GET['code'] . '&client_id=wowonder-verification-78ngohfi&client_secret=SECRET_KEY';
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_POST, 1);
curl_setopt( $ch, CURLOPT_POSTFIELDS, $myvars);
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $ch, CURLOPT_HEADER, 0);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec( $ch );
$json_decode = json_decode($result, true);
if (!empty($json_decode['access_token'])) {
    $access_token = $json_decode['access_token'];
    $result      = file_get_contents("https://api.envato.com/v3/market/buyer/list-purchases?access_token={$access_token}");
    $json_decode = json_decode($result, true);
    foreach ($json_decode['results'] as $key => $item) {
        if ($item['item']['id'] == '19034167') {
            $data_items[] = $item['item']['id'];
        }
    }
}

You shouldn’t be passing access tokens via the URL - it should be passed using the HTTP Authorization header. Here is a sample (from build.envato.com):

curl -H "Authorization: Bearer <token>" https://api.envato.com/v1/market/private/user/account.json

Oh, i see.

Can i pass it using POST method ?

Or which way to send the access_code in PHP ?

Thank you a lot mate, already fixed it !

@DoughouzForest Hi can you tell me how you solved the problem? I am trying to post data this way.

//Getting User profile Details
			$account_detail_url			= "https://api.envato.com/v1/market/private/user/email.json";
			$account_detail_variable	= "token_type=bearer&access_token=".$json_decode["access_token"];
			
			$account_detail_ch 			= curl_init( $account_detail_url );
			
	
			curl_setopt( $account_detail_ch, CURLOPT_POST, 1);
			curl_setopt( $account_detail_ch, CURLOPT_POSTFIELDS, $account_detail_variable);
			curl_setopt( $account_detail_ch, CURLOPT_FOLLOWLOCATION, 1);
			curl_setopt( $account_detail_ch, CURLOPT_HEADER, 0);
			curl_setopt( $account_detail_ch, CURLOPT_RETURNTRANSFER, 1);
			
			
			
			$result_account 		= curl_exec( $account_detail_ch );
			$json_decode_account 	= json_decode($result_account, true);
			
			print_r($json_decode_account);

Thanks!

Here you go:

    <?php
//Getting User profile Details
$account_detail_url         = "https://api.envato.com/v1/market/private/user/email.json";
$account_detail_ch          = curl_init( $account_detail_url );

curl_setopt( $account_detail_ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt( $account_detail_ch, CURLOPT_HEADER, 0);
curl_setopt( $account_detail_ch, CURLOPT_RETURNTRANSFER, 1);

// Send access_token in HTTP
curl_setopt($account_detail_ch, CURLOPT_HTTPHEADER, array(
     'Authorization: Bearer ' . $json_decode["access_token"]
));

$result_account         = curl_exec( $account_detail_ch );
$json_decode_account    = json_decode($result_account, true);

print_r($json_decode_account);
1 Like

Thank you very much! Envato should improve their documentation and provide at least 1 sample if they want to see some great productions with their API.

Thanks again @DoughouzForest Working really well.

1 Like