亚马逊协会 - 无法找到关联标签,API和密钥

时间:2015-05-04 14:13:40

标签: amazon

如何找到此代码的必要密钥?

<?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>";
}

1 个答案:

答案 0 :(得分:4)

要查找您的关联商标,您只需登录您的关联帐户即可。在左侧,您会找到一个显示&#34;跟踪ID&#34;的框,这就是您所需要的。或者只需点击此链接:https://affiliate-program.amazon.com/gp/associates/network/your-account/manage-tracking-ids.html

在AWS管理控制台中,导航至“安全凭证”&#39;在你的名字下拉(https://console.aws.amazon.com/iam/home?#security_credential)下。在&#39;访问键&#39;您可以看到根访问密钥(分配给您使用Product Advertising API注册时创建的root用户的密钥)。 删除一个,然后生成一个新的。它将显示正确的AWS密钥和密钥。这些与适当的Associate Tag配对可以让您访问API。