I've tried implementing Netsuite's OAuth Example, as illustrated here: https://netsuite.custhelp.com/app/an...ail/a_id/42165. (Also posted it directly below here)
Unfortunately, it's not working. I know that I have the correct token and consumer keys and secrets, and the correct account ID. It's giving me a nice error though:
{"error" : {"code" : "INVALID_LOGIN_ATTEMPT", "message" : "Invalid login attempt."}} I can look in my login audits, and see that it's saying that the signature is invalid. But the code itself looks fine and was provided by Netsuite.I've also tried some approaches in Node.JS and haven't gotten them working. A few of the attempts that I've tried other Netsuite customers have working on their end, but they don't seem to be on mine. Any suggestions as to which direction I should go next? import oauth2 as oauth import requests import time url = "https://rest.netsuite.com/app/site/hosting/restlet.nl?script=992&deploy=1" token = oauth.Token(key="080eefeb395df81902e18305540a97b5b3524b251772adf769f06e6f0d9dfde5", secret="451f28d17127a3dd427898c6b75546d30b5bd8c8d7e73e23028c497221196ae2") consumer = oauth.Consumer(key="504ee7703e1871f22180441563ad9f01f3f18d67ecda580b0fae764ed7c4fd38", secret="b36d202caf62f889fbd8c306e633a5a1105c3767ba8fc15f2c8246c5f11e500c") http_method = "GET" realm="ACCT123456" 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) headery = header['Authorization'].encode('ascii', 'ignore') headerx = {"Authorization": headery, "Content-Type":"application/json"} print(headerx) conn = requests.get("https://rest.netsuite.com/app/site/hosting/restlet.nl?script=992&deploy=1",headers=headerx) print(conn.text) Thanks in advance for taking the time to look at this.