I am trying to use suitetalk web service api from an app written in Python.
There isn't much documentation, but from what there is i tried creating the authentication(HMAC-SHA256) but get this each time: error="token_rejected", error_description="Invalid login attempt."
using the same credentials in postman using the collection supplied by netsuite i am able to login and call the API so i know my creds are good and it isn't a permission issue.
the only difference between the postman call and mine are the nonce, timestamp(these two are obvious) and the signature.
I tried using the signature with the following code:
params = {
'oauth_version': "1.0",
'oauth_nonce': oauth.generate_nonce(),
'oauth_timestamp': str(int(time.time())),
'oauth_token': token.key,
'oauth_consumer_key': consumer.key
}
req = oauth.Request(method=http_method, url=url, parameters=params)
signature_method = oauth.SignatureMethod_HMAC_SHA1()
req.sign_request(signature_method, consumer, token)
header = req.to_header(realm)
return header['Authorization']
I thought it was HMAC_SHA1 issue rather then 256, but that encryption works on postman.
I also tried : NetSuite python TBA Authentication
I am quite puzzled and would be grateful for some insights or code snippet that works.