我正在使用Clousale SP-api库来管理亚马逊网站上的产品/订单。在获取目录项时,我收到安全令牌错误。请在下面检查我的代码和错误,
代码
$apiCatalog = new ClouSale\AmazonSellingPartnerAPI\Api\CatalogApi($config);
try{
$result = $apiCatalog->getCatalogItem($marketplaceId, $asin);
print_r($result);
}catch(Exception $e){
echo 'Exception when calling CatalogApi->getCatalogItem: ', $e->getMessage(), PHP_EOL;
}
错误:
Exception when calling CatalogApi->getCatalogItem: [403] Client error: `GET https://sandbox.sellingpartnerapi-na.amazon.com/catalog/v0/items/ASIN?Marketplace
Id=marketplaceId` resulted in a `403 Forbidden` response:
{
"errors": [
{
"message": "The security token included in the request is invalid.",
"code": "InvalidI (truncated...)
对于这个请求,我通过刷新令牌生成访问令牌。我将传递access token, access key, secret key, region, host
给这个 API 请求。但我不明白这个概念,security tokens
也不知道我会从哪里得到它。我也尝试生成RDT token
但面临相同的安全令牌无效问题。
请在这个问题上指导我。谢谢!