1
我使用下面的API来从亚马逊的订单详情AWS签名不匹配
https://mws.amazonservices.com/Orders/2011-01-01?AWSAccessKeyId=aces key&Action=ListOrderItems&SellerId=seller id&AmazonOrderId=order id&Signature=ZQLpf8vEXAMPLE0iC265pf18n0%3D&SignatureVersion=2&SignatureMethod=HmacSHA256&Timestamp=2014-10-04T18%3A12%3A21.687Z&Version=2011-01-01
但是,得到下面的错误
<ErrorResponse>
<Error>
<Type>Sender</Type>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message>
</Error>
<RequestID>ba13b457-bd7c-4413-b138-b216f887ac68</RequestID>
</ErrorResponse>
下面是Python代码生成签名
import hmac
import urllib
from base64 import b64encode
from hashlib import sha256
secret_key = ''
to_sign = """"""
signature=b64encode(hmac.new(secret_key, to_sign, sha256).digest())
request = "%s&Signature=%s" %(to_sign,urllib.quote(signature))
你能告诉我我需要提供什么数据吗to_sign 什么是实际的意思?
还是同样的错误。 我无法弄清楚哪里出错了。 –