Scripted REST API Error response detail

lucky6
Tera Contributor

Hi,

Can anyone provide all the error response codes for rest api ?

Do we have any service now document or url for this?

4 REPLIES 4

Appli
Mega Sage
Mega Sage

Hi, is it what are you looking for?

Hope it helps

Hope it helps

Community Alums
Not applicable

Hi,

For any of the ServiceNow APIs, the stats response codes are listed on the API documentation here (I've linked to the TableAPI as an example): https://developer.servicenow.com/dev.do#!/reference/api/rome/rest/c_TableAPI

 

For a scripted REST API, if the developer that created it hasn't created any documentation, you'll need to review the code to see the status codes it can respond with. 

Mike

 

ersureshbe
Giga Sage
Giga Sage

Hi, Please refer below response codes. The following codes are most frequently affecting.

Please mark as correct answer if it helped.

ID 

Code 

Reason 

Meaning 

Example Body 

1 

201 

Success 

The successful JSON Response 

HTTP/1.1 200 OK 

Content-Length: xxx 

Keep-Alive: timeout= xx, max=xxx 

Connection: Keep-Alive 

 

2 

401 

Unauthorised 

The request header does not contain basic authentication details. The request has been refused 

HTTP/1.1 401 Unauthorised Request 

Content-Length: xxx 

Content-Type: application/vnd.api+json 

 

3 

403 

Forbidden 

Request contains invalid parameters.   

HTTP/1.1 403 Input Request errors 

 

Server: TBD 

Content-Length: 230 

Content-Type: application/vnd.api+json 

4 

500 

Internal Server Error 

There is a problem in ServiceNow Infrastructure 

HTTP/1.1 Internal server error 

 

Server: TBD 

Content-Length: xxx 

Content-Type: application/vnd.api+json 

5 

503 

Service unavailable 

Service is temporarily unavailable and should be retried later.  

This API will not re-try to send the response! 

HTTP/1.1 503 Service Unavailable Request 

Server: TBD 

Content-Length: xxx 

Content-Type: application/vnd.api+json 

 

Regards,
Suresh.