I am getting the following result from an SP-API call using CURL within PHP. It is a private app created in seller central and all permissions have been granted. We are just trying to retrieve our own data.
Array (
[errors] => Array
(
[0] => Array
(
[code] => Unauthorized
[message] => Access to requested resource is denied.
[details] => Access token is missing in the request header.
)
)
)
Access token is retrieved with a refresh token and included, here is the code. amazonApiUrl is https://sellingpartnerapi-na.amazon.com
$headers = array(
'Content-Type: application/json',
'Authorization: Bearer '.$accessToken
);
$curl = curl_init($this->amazonApiUrl."/catalog/2022-04-01/items?marketplaceIds=ATVPDKIKX0DER");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_USERAGENT, 'XXXXXXXXX-app/v1');
$response = curl_exec($curl);
The access token exists and has been retrieved from https://api.amazon.com/auth/o2/token#
What can be wrong ?
I was expecting our products list but getting the above error.