问题
Problem with to call the new SP-API AMAZON. I am using the C# library provided by Amazon.
https://github.com/amzn/selling-partner-api-models/tree/main/clients/sellingpartner-api-aa-csharp!
resource api : https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders
{
"errors": [
{
"message": "Access to requested resource is denied.",
"code": "Unauthorized",
"details": ""
}
]
}
回答1:
You must check the following headers, this error can occur due to the incorrect value from any of them.
- In headers you need to send x-amz-access-token i.e valid for only one-hour post generation through token API.
- You also have to pass the Authorization in headers this will auto-generate in postman if you choose AWS Signature type in Authorization and set the following keys(Access Key, Secret Key, Aws Region, and Service Name).
Also to test sandbox get orders API: URL value should be this https://sandbox.sellingpartnerapi-eu.amazon.com/orders/v0/orders?CreatedAfter=TEST_CASE_200&MarketplaceIds=XXXX
Sandbox API will only work as per the provided sandbox behavior.
来源:https://stackoverflow.com/questions/64560163/access-to-requested-resource-is-denied-403-sp-api-amazon-c-sharp