Closed winterstefan closed 3 years ago
Hi @winterstefan, Within the signRequest method, we remove certain headers from the request headers before we sign, so that shouldn't be the issue. Did it work when you tried presigning the request instead? Or have you tried another using the CLI or another SDK and seen the same results?
Hello @SamRemis,
thank you for reaching out. Glad to hear, that additional headers should not be a problem. What do you mean by presigning
the request?
At first, I tried to follow the SP-API guidelines for signing a request by hand. But with that, I didn't come anywhere near a successfully created signature.
So after some research, I stumbled upon the idea of using the AWS part to create the signature. I double-checked the source code, that actually creates the signature and it looked like the description I linked from documentation. So by that point, I relied on the AWS SDK.
Do you know some other SDK that implements the process?
Soo, after debugging day after day, I finally got the missing part. So thanks @SamRemis for reaching out initially, I'll close this issue and leave a quick note for others who might run into that problem.
In order to have the signature being valid, I need to assume the API role via AWS SDK thus getting actual credentials back. That was not mentioned in the docs I've read on the Selling Partner API. A kind person created a functional PHP example over here (link to the assumeRole
call).
Thanks guys & stay save
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
@winterstefan thank you so much for following up and posting the solution, and I apologize for not being able to get it to you faster. I have been in contact with the selling partner team, and will ask them to update their docs so that other customers don't experience this issue.
Awesome, thanks for reaching out to the SP team. 👍
@SamRemis I am having same problem. I am using python package request for the authentication and signing in but, I have same error message. @winterstefan can please provide some additional information for example what is not mentioned in the documentation and what is missing because I could not understand PHP. Can you please give me detailed answer? Thanks!!
Hi there,
my current use-case is to create an Amazon Application which accesses seller information (like inventory reports) via the newly launched Selling Partner API. For that, I'm using a PHP backend and try signing the SP-API requests with this AWS SDK. Indeed I'm aware that this repository neither supports topics for SP-API, Amazon Application development and such. But I'm at a very point, where signing a random request via the SDK fails. So now I'm humbly searching for help here since no other party was able to assist.
If I'm purely wrong here please accept my apology.
What I've done before opening this ticket
All that without a proper solution, unfortunately.
My setup
v7.3.11
v3.166.0
(latest tag right now)Guzzle
http client for making the requestMy use-case
sandbox
SP-API and try it with my developer seller accountMy problem
InvalidSignature
error from the API.Request
Here's the PHP code using the AWS SDK 'by hand' for signing the request. See this documentation for which params need to be in place for the SP-API request.
The actual request data:
Response
Any help or hint is appreciated. Reading
Check your AWS Secret Access Key and signing method.
I double checked the keys, so would leave just the signing method open. I tried to send and omit lots of request params (like theAccept
andContent Type
headers), since I've read this could influence the signing process. But right now I'm out of ideas, to be honest.