Errorcode: 1008, message: Unable to parse request.
Objective: Adding a row on smartsheet from ERP NetSuite (Uses javascript).
The payload generated by NetSuite works perfectly via postman !
Header: {"Content-Type":"application/json","Authorization":"Bearer XXXXXXXXXXXX","Accept":"application/json","Content-Length":1338,"Host":"api.smartsheet.com"}
Body: [{"sheetId":"XXXXXXXXXXXXXX","accessLevel":"COMMENTER","cells":[{"columnId":"3330819643887492","netsuiteId":"tranid","value":"SOUSACR32","displayValue":"SOUSACR32"},{"columnId":"5465404162920324","netsuiteId":"item","value":"KIT100015","displayValue":"KIT100015"},{"columnId":"3213604349235076","netsuiteId":"quantity","value":"1","displayValue":"1"},{"columnId":"1079019830202244","netsuiteId":"custbody_acl_storeaddress","value":"StoreXXXX\r\n5736 N Hamilton AVE\r\nColumbus OH 43230\r\nUnited States","displayValue":"StoreXXXX\r\n5736 N Hamilton AVE\r\nColumbus OH 43230\r\nUnited States"},{"columnId":"8397369224679300","netsuiteId":"custbody_acl_soldto","value":"USDKN363022","displayValue":"USDKN363022"},{"columnId":"1748188082950020","netsuiteId":"custentity_acl_brand","value":"DKN","displayValue":"DKN"},{"columnId":"5582619457572740","netsuiteId":"custbody_store_status","value":"Existing","displayValue":"Existing"},{"columnId":"7834419271257988","netsuiteId":"custbody_acl_reqinstalldate","value":"2024-05-31","displayValue":"2024-05-31"},{"columnId":"3893769597308804","netsuiteId":"formulatext","value":"SOUSACR32_KIT100015_1","displayValue":"SOUSACR32_KIT100015_1"}]}]
Response: {"type":"http.ClientResponse","code":400,"headers":{"Content-Type":"application/json;charset=UTF-8","content-type":"application/json;charset=UTF-8","Date":"Sun, 14 Apr 2024 22:00:22 GMT","date":"Sun, 14 Apr 2024 22:00:22 GMT","server":"nginx/1.25.4","Server":"nginx/1.25.4","Transfer-Encoding":"chunked","transfer-encoding":"chunked","Via":"1.1 mono001.prod-fra-eu7.core.ns.internal","via":"1.1 mono001.prod-fra-eu7.core.ns.internal","x-envoy-upstream-service-time":"3","X-Envoy-Upstream-Service-Time":"3","x-ratelimit-limit":"80000","X-Ratelimit-Limit":"80000","x-ratelimit-remaining":"79600","X-Ratelimit-Remaining":"79600","x-ratelimit-reset":"1713132082","X-Ratelimit-Reset":"1713132082","x-smar-halo-version":"2098546","X-Smar-Halo-Version":"2098546"},"body":"{\"refId\":\"fc55fdd2-ce60-42f0-9a31-85327b06045f\",\"errorCode\":1008,\"message\":\"Unable to parse request.\"}"}
What is the wrong with the script ?
Answers
-
A few things here:
- I notice you have the permission level set as COMMENTER, however you're looking to add a row, is that correct? If so, you'll need at least Editor permissions on the sheet to add a row.
- If the payload works through Postman but not a different way, it sounds like this may potentially have to do with ERP NetSuite. I would potentially suggest reaching out in the NetSuite Support Community to see if others using NetSuite have had the same issue.
- If none of this has helped and if no other Smartsheet member in this Community has a solution, I would suggest posting in StackOverflow (a developer community) to get some extra eyes on your code.
Cheers,
GenevieveNeed more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 67 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives