亚马逊产品广告API签名问题 [英] Amazon Product Advertising API Signing Issues

查看:67
本文介绍了亚马逊产品广告API签名问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用亚马逊网络服务示例代码页中发布的以下代码在亚马逊产品数据库中进行搜索

i am trying to search in amazon product database with the following code posted in amazon webservice sample codes page

AWSECommerceService ecs = new AWSECommerceService();

// Create ItemSearch wrapper
ItemSearch search = new ItemSearch();
search.AssociateTag = "ABC";
search.AWSAccessKeyId = "XYZ";

// Create a request object
ItemSearchRequest request = new ItemSearchRequest();

// Fill request object with request parameters
request.ResponseGroup = new string[] { "ItemAttributes" };

// Set SearchIndex and Keywords
request.SearchIndex = "All";
request.Keywords = "The Shawshank Redemption";

// Set the request on the search wrapper
search.Request = new ItemSearchRequest[] { request };

try
{
    //Send the request and store the response
    //in response

    ItemSearchResponse response = ecs.ItemSearch(search);
    gvRes.DataSource = response.Items;
}
catch (Exception ex) 
{
    divContent.InnerText = ex.Message;
}

并出现以下错误

请求必须包含参数签名.

The request must contain the parameter Signature.

并且亚马逊文档尚不清楚如何签署请求.

and amazon documentation is not clear about how to sign the requests.

任何想法如何使其工作?

any idea how to make it work???

thx

推荐答案

REST有一个名为SignedRequestHelper的帮助程序类.

There's a helper class for REST called SignedRequestHelper.

您这样称呼它:

SignedRequestHelper helper =
        new SignedRequestHelper(MY_AWS_ACCESS_KEY_ID, MY_AWS_SECRET_KEY, DESTINATION);
requestUrl = helper.Sign(querystring);

以上链接中的SOAP调用必须有一个类似的

There must be a similar one for SOAP calls in the above links.

这篇关于亚马逊产品广告API签名问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆