Amazon SP-api 请求中包含的安全令牌无效错误

问题描述

我正在使用 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,但面临相同的安全令牌无效问题。

请指导我解决这个问题。谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)