Skip to content

Amazon SP-API - Works for everything except for POST #145

Description

@Landsailor

Hmmm, describing this may have been enough Duck Debugging to point me to where I need to go... :)

I am nowhere approaching a "JavaScript dev", so I set up a node-red server to handle various Amazon SP-API related duties. This might be an issue with my implementation, function code, or Amazon's Selling Partner API itself.

I created an endpoint that uses aws4 to generate the signature based on query data submitted via a GET, returns it, and is then used for requests in our server. It works for everything except POST requests. Those always return a similar "Close, but no cigar" message from Amazon:
node-red AWS4 POST Signature Error

Here's the function where I have tried enabling and disabling various options to try to get it to work:
node-red AWS4 Function Text
They all return a result similar to the one shown.

When I run the identical request in Postman using the same credentials, it works. However, I noticed that Postman also generates a X-Amz-Content-Sha256 header which is not a hash of the just body text.

Any ideas here? Is there any way to get aws4 to return the Canonical Request and StringToSign for debugging purposes?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions