1

I'm trying to use Excel to connect to a netsuite restlet script to pull information and populate a sheet.

I have tried to connect via "web" and entering the url and adding headers. If I try to add the content-type to be application/json, I get an error that "name":"INVALID_RETURN_DATA_FORMAT","message":"Invalid data format. You should return TEXT"

I saw that I can connect to a JSON file via Excel, or to a webservice, but it doesn't seem to return the json object. Is there something I am doing wrong? I have the authorization and content-type headers, and my url is correct for the external url of the webservice. Is there a better way to do this?

The purpose of this file is to essentially pull down records of a certain type into Excel, allow the user to edit, and then push that information back into Netsuite. The restlet is working well, now I just need to get the Excel portion working properly.

Thanks!

1
  • I built something similar in the past, but my implementation only brought data down from NetSuite, never pushed things back. I ended up having to use a combination SUITElet and RESTlet to get the authentication and return type to work properly. I would love to chat more about what you built and possibly collaborate on additional functionality. My contact info is in my profile, shoot me a message sometime. Commented Feb 15, 2018 at 19:28

1 Answer 1

1

You need to include a Content-Type Header in your request.

Content-Type: application/json

NetSuite looks at this not only to identify the request body format, but also the encoding of the Restlet's response. (It's a bit counter-intuitive, because usually an Accept header is used to tell the server the response content type expected, especially if you are just sending a GET request that doesn't even have a body.. but that's NetSuite..)

For more details see the Help Center topic "Creating a Content-Type Header"

Sign up to request clarification or add additional context in comments.

2 Comments

Hmmm, okay, I have done this, but now I just get [Object object][Object object][Object object][Object object][Object object] in my response text. When I try to parse this, i get an error, since it is obviously not json. I know that the restlet returns the proper json because if I run it using postman, I get the right information in the right format.
I got this error when trying to call Restlet through Postman. Adding "Content-Type" fixed it for me. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.