Empty JSON String - POST API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 03:47 AM
Hi ,
While doing test load on the Data Source , I am getting the below error and Data Source type ; Custom Load by Script .
and error is in OOB Script Include : JSON .
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 04:15 AM
which script include is that?
Also did you try running that script in background and see if API response came fine?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:49 PM
Error : While running in background script
Request not sent to uri= https://XYZ.com/api/aps?pagesize=0&totalcountrequired=true&startindex=0 : java.net.UnknownHostException: XYZ.com
Script execution error: Script Identifier: null.null.script, Error Description: Empty JSON string, Script ES Level: 0
Evaluator: com.glide.script.RhinoEcmaError: Empty JSON string script : Line(155) column(0)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2025 10:59 PM
so that's the issue.
The API is not giving any response and your script is trying to parse something and it's getting broken.
Please verify if API end point is correct and if it's configured to return some response
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader