Error while calling External REST URL from netsuite using token

hem

I am not getting valid json response while calling 3rd party REST GET URL from netsuite . The 3rd party api is using oAuth2 , so i am passing the bearer token like this in the UserEvent Script . Can someone please tell what is wrong with this code .Below is the code snippet.

var sURL = "REST URL";

var header = { "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55X2lkIjoiYXBpdXNlck1ITVUiLCJ1c2VyX25hbWUiOiJhcGl1c2VyIiwic2NvcGUiOlsiYWNjdF9wYXlhYmxlIl0sImV4cCI6MTU0MzcxOTY3NCwiYXV0aG9yaXRpZXMiOlsiUk9MRV9VU0VSIl0sImp0aSI6IjU4MjA2YTRkLTRhYTgtNDNjNy1iZTY2LWM2YTQ1NTg0YTY2ZSIsImNsaWVudF9pZCI6Im5ldHN1aXRlLWNsaWVudCJ9.dPuwIpzZW3VrhkJnF_HaaNe8t4AMQ84UgMY5ZOK6j7g", 
                        "Content-Length": "0", 
                        "Content-Type": "application/json" };

        var request = https.get({
            url: sURL,
            headers: header
        });

        log.debug('req',request);

Getting below output in debugger:

{"type":"http.ClientResponse","code":406,"headers":{"X-Content-Type-Options":"nosniff","Pragma":"no-cache","Date":"Sat, 01 Dec 2018 23:46:46 GMT","Via":"1.1 mono00001.svale.netledger.com","X-Frame-Options":"DENY","Cache-Control":"no-cache, no-store, max-age=0, must-revalidate","Set-Cookie":"JSESSIONID=4E42866C0A8D2D8504581B74C8D6FC1C; Path=/; HttpOnly","Expires":"0","Content-Length":"806","X-XSS-Protection":"1; mode=block","Content-Language":"en","Content-Type":"text/html;charset=utf-8"},"body":"HTTP Status 406 – Not Acceptableh1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} h2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} h3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} body {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} b {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} p {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} a {color:black;} a.name {color:black;} .line {height:1px;background-color:#525D76;border:none;}

HTTP Status 406 – Not Acceptable

" }

erictgrubaugh

NetSuite does not support oauth2.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Error while putting a External Suitelet URL in value property of QR Code. NetSuite

From Dev

error while calling a rest webservice

From Dev

405 error code while calling from Jersey REST client

From Dev

Calling a Telegram Token from an external file

From Dev

Load and read CSV from external URL in Netsuite scheduled script

From Dev

ERROR while calling post request from rest api made with Node Js and express .the request data goes empty

From Dev

Django Rest Framework: Calling Internal API from External API

From Dev

Calling an external rest service from Alfresco Share page

From Java

Error on external REST endpoint call using RestTemplate

From Dev

Error in the code while trying to read from URL using XML, xmlParse

From Dev

Error while calling C# from java using jni4net from 64 bit Os

From Dev

authorization error while calling adapter from iphone

From Dev

Error while calling java from PL/SQL

From Dev

Error while calling Fragment class from activity

From Dev

How can in_array work while fetching values from external URL using PHP

From Dev

Start token not found error while using JsonSerDe

From Dev

CORS error while consuming calling REST API with React

From Dev

Calling python script from c#, unexpected token 'from' error

From Dev

Error while calling Navigation Components while using ViewPager 2

From Dev

CORS issue on localhost while calling REST service from angularjs

From

Permission Denied error calling external service from appengine go

From Dev

Parsing JSON HTTP request from Netsuite to Heroku returns error "SyntaxError: Unexpected token p"

From Dev

Error while connecting to PayPal using REST API

From Dev

404 Error From OAuth Token URL

From Dev

CORS policy error while calling remote URL in Angular

From Dev

Error while calling spring controller action through URL posting

From Dev

Getting "Syntax Error: Unexpected Token" when calling a function from ajax

From Dev

Error calling graph API with access token from django-allauth

From Dev

Get data from external URL in JSON format with Django REST

Related Related

  1. 1

    Error while putting a External Suitelet URL in value property of QR Code. NetSuite

  2. 2

    error while calling a rest webservice

  3. 3

    405 error code while calling from Jersey REST client

  4. 4

    Calling a Telegram Token from an external file

  5. 5

    Load and read CSV from external URL in Netsuite scheduled script

  6. 6

    ERROR while calling post request from rest api made with Node Js and express .the request data goes empty

  7. 7

    Django Rest Framework: Calling Internal API from External API

  8. 8

    Calling an external rest service from Alfresco Share page

  9. 9

    Error on external REST endpoint call using RestTemplate

  10. 10

    Error in the code while trying to read from URL using XML, xmlParse

  11. 11

    Error while calling C# from java using jni4net from 64 bit Os

  12. 12

    authorization error while calling adapter from iphone

  13. 13

    Error while calling java from PL/SQL

  14. 14

    Error while calling Fragment class from activity

  15. 15

    How can in_array work while fetching values from external URL using PHP

  16. 16

    Start token not found error while using JsonSerDe

  17. 17

    CORS error while consuming calling REST API with React

  18. 18

    Calling python script from c#, unexpected token 'from' error

  19. 19

    Error while calling Navigation Components while using ViewPager 2

  20. 20

    CORS issue on localhost while calling REST service from angularjs

  21. 21

    Permission Denied error calling external service from appengine go

  22. 22

    Parsing JSON HTTP request from Netsuite to Heroku returns error "SyntaxError: Unexpected token p"

  23. 23

    Error while connecting to PayPal using REST API

  24. 24

    404 Error From OAuth Token URL

  25. 25

    CORS policy error while calling remote URL in Angular

  26. 26

    Error while calling spring controller action through URL posting

  27. 27

    Getting "Syntax Error: Unexpected Token" when calling a function from ajax

  28. 28

    Error calling graph API with access token from django-allauth

  29. 29

    Get data from external URL in JSON format with Django REST

HotTag

Archive