Archived Forum Post

Index of archived forum posts

Question:

MWS ListOrders / ListOrdersByNextToken

Aug 09 '17 at 12:24

Hi I am using the REST to process an MWS request to Amazon for ListOrders That works fine!

To get subsequent pages thou I use the NextToken given by Amazon in the ListOrders result and pass this to ListOrdersByNextToken. When I send this to Amazon it fails with an invalid Signature so I am wondering if anyone has any sample code of this process. I am concerned that the AddMwsSignature in ChilKat is somehow not getting or incorrectly signing the Token as all the otehr parameters etc are the same as ListOrders!

Thanks

Andy


Answer

I found the problem. I turns out that the Amazon documentation is incorrect. This has an error: https://docs.developer.amazonservices.com/en_US/dev_guide/DG_QueryString.html

It specifically states that:

Do not URL encode any of the unreserved characters that RFC 3986 defines. These unreserved characters are A-Z, a-z, 0-9, hyphen ( - ), underscore ( _ ), period ( . ), and tilde ( ~ ).

But in reality, one must also encode the '/' char -- and this was the char in the NextToken value that caused trouble.