Forum Discussion
yossifisch
Advocate I
9 years agoConnect to MWS - Amazon Seller Central API
Hi, I was wondering if it's possible to connect to Power BI to the Amazon API (MWS) for sellers. If yes, where would I begin on Power BI? The API documentation is at: https://developer.amazonser...
hawdong
6 years agoFrequent Visitor
It absolutely works with Postman. Here's how in roughly 2 steps:
1) In Postman, define Body as such:
To save you from typing, here's the code. Be sure to replace keys/secret with your own.
AWSAccessKeyId:YOURACCESSKEY
Action:GetReportRequestCount
Merchant:YOURMERCHANTKEY
MWSAuthToken:amzn.mws.e6afcd81-0714-a5fa-223e-656b6e2e4a1e
SignatureVersion:2
Timestamp:{{timestamp}}
Version:2009-01-01
Signature:{{signature}}
SignatureMethod:HmacSHA256
2) Define Pre-request script as follows:
To save you from typing, here's the code. Be sure to replace keys/secret with your own.
var CryptoJS = require('crypto-js');
var timestamp = new Date().toISOString();
pm.environment.set("timestamp", timestamp);
var post = "POST\nmws.amazonservices.com\n/\nAWSAccessKeyId=YOURACCESSKEY&Action=GetReportRequestCount&MWSAuthToken=amzn.mws.e6afcd81-0714-a5fa-223e-656b6e2e4a1e&Merchant=YOURMERCHANTID&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=" + encodeURIComponent(timestamp) + "&Version=2009-01-01";
var hash = CryptoJS.HmacSHA256(post, "YOUR SECRET KEY");
var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
pm.environment.set("signature", hashInBase64);
The response from MWS:
michaelsh
Kudo Kingpin
5 years agoHave you managed to connect?
In Power Query I am not able to find a SHA1/SHA256 hash function to generate oauth_signature