0

I have been spending hours trying to figure this out but I can't seem to make it work. I am really not sure if I am putting the correct info on the authorization header of my Ajax request since I cannot find information about Oauth 1.0 ajax related. Please help me thanks!

    $.ajax({
        crossDomain : true, 
        type: "GET",
        url: "https://myaccountID.suitetalk.api.netsuite.com/services/rest/record/v1/customer",
        dataType: 'json',
        headers: { //authorization header that will be sent to be able to GET the desired data
            "Authorization" : "Oauth 1.0",
            "oauth realm" : accountID,
            "oauth_consumer_key" : consumerKey,
            "oauth_token" : tokenSecret,
            "oauth_signature_method" : signatureMethod,
            "oauth_signature" : oauthSignature,
            "oauth_timestamp" : timeStamp,
            "oauth_nonce" : oauthoNonce,
            "oauth_version" : oauthVer
        },
        success: function(result) {
       
            alert(result);
        }
    });
Binsoy
  • 1
  • 1

1 Answers1

0

The SuiteTalk REST interface uses OAuth 2.0. so the approach you are attempting is not the recommended one. The Netsuite help is pretty extensive on that topic.

If you are just using this to test on your way to communicating with a RESTlet see Netsuite OAuth Not Working

bknights
  • 14,408
  • 2
  • 18
  • 31