1
votes

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.Todd Grimm

1 Answers

1
votes

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"