Invalid signature error 401 REST API magento 2
See original GitHub issueHello. I’m trying to create a request to magento 2 REST API. I use oauth and have all tokens (consumer, consumer secret, token and token secret). I need to pass param like this: http://devdocs.magento.com/guides/v2.1/howdoi/webapi/search-criteria.html
My code:
const optionsToRequest = {
url: `http://host/rest/V1/customers/search`,
json: true,
oauth: {
consumer_key: CONSUMER_KEY,
consumer_secret: CONSUMER_SECRET,
token: TOKEN,
token_secret: TOKEN_SECRET
},
qsStringifyOptions: {
encode: false,
},
qs: { 'searchCriteria[filter_groups][0][filters][0][field]': 'email'}
};
request.get(optionsToRequest)
.then(res => console.log(res));
and when i’m creating request then get response with error {"message":"Invalid signature"}
.
searchCriteria param looks like:
searchCriteria[filter_groups][0][filters][0][field]=email
. I also tried to create a query in POSTMAN and there everything is ok. I don’t understand this. Where is the mistake?
The entire query should look like this:
http://host/rest/V1/customers/search?searchCriteria[filter_groups][0][filters][0][field]=email
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Invalid Signature - add a product using Magento REST API
i have created AccessToken and AccessTokenSecret as mentioned in the Oauth Rest API Documentation and I am able to retrieve the products ...
Read more >Magento Rest Oauth API (Signature Invalid) 401
In my case, the local webserver runs on port 81, thus my signature and the Magento one could not match. By passing the...
Read more >Developers - Invalid signature error 401 REST API magento 2 -
Hello. I'm trying to create a request to magento 2 REST API. I use oauth and have all tokens (consumer, consumer secret, token...
Read more >Invalid Signature – add a product using Magento REST API
i have created AccessToken and AccessTokenSecret as mentioned in the Oauth Rest API Documentation and I am able to retrieve the products using...
Read more >Magento 2 API returns "The signatire is invalid. Verify and try ...
A lot of time has passed since you posted this question and I don't see any answer for it. I'm running into the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Is there any fix for this issue?
is there anyone can fix this issue?