Generating Signature in Postman -
Example API Call -
curl -X GET \
'http://xxx.api.mashery.com/bhavani4?apiKey=<apiKey>&sig=588ab8ecbd5f7c435c0e3b14e1915fb2'
Here 'sig' query parameter is generated in Postman through Pre-request Script. Below is the script -
var mymd5str = CryptoJS.SHA256("<clientID>" + "<clientSecret>" + Math.round((new Date()).getTime()/1000));
// for MD5, use CryptoJS.MD5
postman.clearGlobalVariable("signature");
postman.setGlobalVariable("signature", mymd5str);
URL to be used in Postman - http://xxx.api.mashery.com/bhavani4?apiKey=<apiKey>&sig={{signature}}
please note the {{signature}} element, it comes from the global variable defined in pre-request script.
Generating Signature with curl -
md5-
curl 'http://xxx.api.mashery.com/bhavani4?apiKey=<apiKey>&sig='$(php -r 'echo hash("md5","<clientID>"."clientSecret".time());')
sha256-
curl 'http://xxx.api.mashery.com/bhavani4?apiKey=<apiKey>&sig='$(php -r 'echo hash("sha256","<clientID>"."clientSecret".time());')