Empty JSON String - POST API

naveenreddy0871
Tera Contributor

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 .

naveenreddy0871_0-1740397585314.png

 

Thanks 

 

 

7 REPLIES 7

@naveenreddy0871 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar 

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)

 

@naveenreddy0871 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader