RE: Netsuite2.com TBA failure
Hi Everyone,
Would anybody be able to provide some assistance?
Yea you need a script like this to generate the signature on the fly because it uses the current timestamp. You can’t really do this if you’re just using the ODBC driver on your laptop because you have to generate it each time you want to login. But if you have some Python script running, then you can generate the signature and pass it to the ODBC driver as the password parameter. Here is the actual script that I use in Postman:
See:
let account = ‘12345678_SB2’; let consumerKey = ‘xxxxx’; let consumerSecret = ‘xxxx’; let tokenId = ‘xxxx’; let tokenSecret = ‘xxxx’;
let timestamp = new Date().getTime().toString().substring(0, 10); let nonce = CryptoJS.lib.WordArray.random(10).toString(); let baseString = account + ‘&’ + consumerKey + ‘&’ + tokenId + ‘&’ + nonce + ‘&’ + timestamp; let key = consumerSecret + ‘&’ + tokenSecret; let signature = CryptoJS.HmacSHA256(baseString, key).toString(CryptoJS.enc.Base64);
pm.environment.set(“account”, account); pm.environment.set(“consumerKey”, consumerKey); pm.environment.set(“tokenId”, tokenId); pm.environment.set(“nonce”, nonce); pm.environment.set(“timestamp”, timestamp); pm.environment.set(“signature”, signature);