php - Amazon Associates - 找不到关联标签、API 和 key

标签 php amazon-ecs amazon-selling-partner-api

如何找到此代码运行所需的 key ?

<?php
/**
 * For a running Search Demo see: http://amazonecs.pixel-web.org
 */

if ("cli" !== PHP_SAPI)
{
    echo "<pre>";
}




defined('AWS_API_KEY') or define('AWS_API_KEY', '...');
defined('AWS_API_SECRET_KEY') or define('AWS_API_SECRET_KEY', '...');
defined('AWS_ASSOCIATE_TAG') or define('AWS_ASSOCIATE_TAG', '...');

// require '../lib/AmazonECS.class.php';
require_once ( dirname(__FILE__) . '/../classes/buyamerica/AmazonECS.class.php');


try
{
    $amazonEcs = new AmazonECS(AWS_API_KEY, AWS_API_SECRET_KEY, 'com', AWS_ASSOCIATE_TAG);

    // for the new version of the wsdl its required to provide a associate Tag
    // @see https://affiliate-program.amazon.com/gp/advertising/api/detail/api-changes.html?ie=UTF8&pf_rd_t=501&ref_=amb_link_83957571_2&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=&pf_rd_s=assoc-center-1&pf_rd_r=&pf_rd_i=assoc-api-detail-2-v2
    // you can set it with the setter function or as the fourth paramameter of ther constructor above
    $amazonEcs->associateTag(AWS_ASSOCIATE_TAG);

    // First of all you have to set an another ResponseGroup. If not the request would not be successful
    // Possible Responsegroups: BrowseNodeInfo,MostGifted,NewReleases,MostWishedFor,TopSellers
    $amazonEcs->responseGroup('BrowseNodeInfo');
    // $asin = "B00625Q56U";
    $asin = $_REQUEST["asin"];
    $res = $amazonEcs->responseGroup('Large')->lookup($asin);

    var_dump($res->Items->Item);

}
catch(Exception $e)
{
  echo $e->getMessage();
}

if ("cli" !== PHP_SAPI)
{
    echo "</pre>";
}

最佳答案

要查找您的合作伙伴标签,您只需登录您的合作伙伴帐户即可。在左侧,您会发现一个框,上面写着“跟踪 ID”,这就是您所需要的。或者只需点击此链接:https://affiliate-program.amazon.com/gp/associates/network/your-account/manage-tracking-ids.html

在 AWS 管理控制台中,导航到您姓名 ( https://console.aws.amazon.com/iam/home?#security_credential ) 下拉列表下的“安全凭证”。在“访问 key ”下,您可以看到您的根访问 key (分配给您注册产品广告 API 时创建的根用户的 key )。 删除一个,然后生成一个新的。它将向您显示正确的 AWS key 和 key 。这些与正确的关联标签配对应该可以让您访问 API。

关于php - Amazon Associates - 找不到关联标签、API 和 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30032354/

相关文章:

amazon-web-services - ECS 服务在创建时超时

amazon-web-services - Amazon SP-API Listings API putListingsItem 如何更新价格和数量? Node.js

php - 发送 AJAX 到 PHP 不显示

某些电子邮件无法访问 PHP IMAP 电子邮件附件

php - Context::getContext() 如何在 Prestashop Bankwire 模块中使用

c# - 如何使用 Restsharp 从 Amazon SP-API 请求受限数据 token (RDT)

php - 选择定义了其他列的 mysql 列(即数组),:- and insert it into php variable

amazon-web-services - ECS任务定义中容器间的通信

amazon-web-services - 我可以安排Docker在特定时间在Amazon ECS上运行吗?