This is a simple script that will generate an API signature for any Publitio API call via Postman.
let API_KEY = "YOUR API KEY HERE" let API_SECRET = "YOUR API SECRET HERE" let rand = String(Math.floor(Math.random() * (99999999 - 10000000 + 1)) + 10000000) let timestamp = String(Math.floor(Date.now() / 1000)) let signature = timestamp.concat(rand, API_SECRET) signature = CryptoJS.SHA1(signature).toString() let query = "?api_key=" + API_KEY + "&api_nonce=" + rand + "&api_signature=" + signature + "&api_timestamp=" + timestamp postman.setEnvironmentVariable("api_signature", query);
Comments
0 comments
Please sign in to leave a comment.