我们如何拒绝我们解决“访问请求的资源”。关于亚马逊销售合作伙伴API的Getorders操作?
在按照以下说明和示例提供的说明和示例 getOrders 请求 sp-api/doc/连接到销售销售 - 帕特纳 - api“ rel =” nofollow noreferrer”> https://developer-docs.amazon.com/sp-api/docs/connecting-to-to-to-the-selling-partner-api-api 和 https://developer-docs.amazon.com/sp-api/docs/orders-api-v0-reference 。
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": ""
}
]
}
我们已经在 drard 状态中注册了一个自授权的应用程序客户端,该状态已在 https://developer-docs.amazon.com/sp-api/docs/registering-your-application 。
我已经检查了ARN IAM的内联和角色政策。它们完全如 https://developer-docs.amazon.com/sp-api/docs/creating-and-configuring-iam-policies--policies-and-entities-undities#step-4-create-an-an-iam-role 。
在Postman中使用AWS签名版本4进程,我们能够按照 https://developer-docs.amazon.com/sp-api/docs/orders-api-v0-reference 。但是,我们得到了上面未经授权的响应。
目前尚不清楚 getorders 操作是否需要RDT,因为它在此处列出了 https://developer-docs.amazon.com/sp-api/docs/tokens-api-us-case-case-guide-guide-crestrative-ertrication-ererations 。但是,然后在 https://developer-docs.amazon.com/sp-api/docs/tokens-api-use-case-case-guide-guide#step-1-get-get-ag-an-order-isor-id 您需要一个订单ID才能获取RDT并为订单ID列表拨打 getorders ,然后获取特定订单ID的RDT,然后使用带有后续调用的RDT,例如 getorderitems 。因此,在我看来,初始 getorders 呼叫应该/不需要RDT。
因此,目前尚不清楚需要做些什么来解决 getorders 操作的未经授权的响应。
还有其他人解决了这个问题吗?我们已经在Amazon Developer Support的情况下开设了几个支持案例,只是让案例结束,并从我上面引用的页面复制了模板响应。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您仍然需要此问题的帮助吗?如果是这样,这里有一些可能的问题:
- 申请时,您已经被批准直接用于消费者运输
。
2.)RDT应在以下信息中获得:
邮政正文以获取RDT应包括:
“ targetApplication”:您的应用程序ID(来自卖方中央 - >开发应用程序 - >应该看起来像amzn1.sp.soldition。 (更多字符))
因此,当您是具有自授权的私人应用程序时,身体应以JSON格式看起来像这样:
需要目标应用 。我知道这不在文档中。可以获取RDT,但如果不包括目标签名,则不起作用。
3.)看来您是一个私人应用程序,打算保留在草案状态。
如果是这样,请确保是这样的:
3A。)确保您的应用程序已在用户ARN上注册,而不是像文档所建议的那样的角色。
3B。)确保您没有该用户的政策或角色。
3C。)向用户添加内联策略。页面进入JSON选项,
如果您必须更改ARN,则必须生成新的刷新令牌。
如果您拥有成功的RDT令牌,则以下问题可能是一个问题:
获得订单的请求需要以下查询字符串参数最小值:
请求应用程序的请求(createfter)或Lastupdatedfter)
和MarketPlaceIds
它们也必须按字符代码顺序为顺序。在这种情况下,创建后又有MarketPlaceIds
Createfter必须采用ISO 8601格式。
可以在此处找到MarketPlaceIDS: https://developer-dock.amazon.com /sp-api/docs/marketplace-ids
另一种可能性是您在错误的位置使用了错误的密钥,即:
如果这些工作都没有,请告诉我。我已经解决了许多SP-API问题。
Do you still need help with this issue? If so, here are some possible issues:
--assuming you have already been approved for direct to consumer shipping when you applied
1.) Yes you do need an RDT for getOrders.
2.) The RDT should be obtained with the following information:
POST body to acquire the RDT should include:
"targetApplication": your application ID (from seller central -> develop apps -> should look like amzn1.sp.solution.(more chars))
so the body should look like this in json format:
targetApplication IS required when you are a private application with self authorization. I know this is not in the docs. It is possible to get an RDT but have it not work if the targetApplication is not included.
3.) It seems you are a private application which intends to remain in draft status.
if so, make sure that this is the case:
3a.) Make sure your app is registered with the USER ARN not the role ARN like the documentation suggests.
3b.) make sure you DO NOT have a policy or role attached to that user.
3c.) add an inline policy to the user. Page into the JSON option the following
if you had to change your ARN, you must generate an use a new refresh token.
If you have a successful RDT TOKEN, then the following may be an issue:
a request to get orders requires the following query string parameters minimum:
a request to getOrders for your app requires either (CreatedAfter or LastUpdatedAfter)
and MarketplaceIds
they must also be in order of character code. In this case, CreatedAfter and then MarketplaceIds
CreatedAfter must be in ISO 8601 format.
marketplaceIds can be found here: https://developer-docs.amazon.com/sp-api/docs/marketplace-ids
another possibility is that you are using the wrong keys in the wrong places IE:
if none of these work, please let me know. I have worked through a lot of SP-API issues.
您是否阅读了 conded订单文档?为了进行某些订单API调用,您需要“批准在开发人员资料中直接到消费者交付(限制)角色”和“在应用程序注册页面中选择的直接到消费者交付(受限制)角色'。
确保您拥有这些权限,并遵循指示如何完成这些呼叫。
Have you read the Regulated Orders documentation? To make certain orders API calls, you need 'Approval for the Direct-to-Consumer Delivery (Restricted) role in your developer profile' and 'The Direct-to-Consumer Delivery (Restricted) role selected in the App registration page for your application'.
Ensure you have these permissions and follow the directions for how to complete these calls.