- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 07:30 AM
Hi
We have requirement to modify status code of a rest api call.We are doing integration using staging tables.Once data is received through Rest Import set API, the status code is set as 201 Created but when our transform scripts run it may throw error depending upon validation. We are throwing error through status_message and error_message variables but we would also want to modify the status code. I am attaching screenshot for reference. Is there any way to achieve this?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 07:35 AM
As far as I know, the status codes are standard HTTP Response Codes defined at the platform layer. They are not configurable or overriding. Doing so could cause serious problems with other integrations.
You MAY be able to change them if you use a script REST API of your own. I haven't checked in this lately.
Getting Started with REST - ServiceNow Wiki
REST API Explorer - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 07:35 AM
As far as I know, the status codes are standard HTTP Response Codes defined at the platform layer. They are not configurable or overriding. Doing so could cause serious problems with other integrations.
You MAY be able to change them if you use a script REST API of your own. I haven't checked in this lately.
Getting Started with REST - ServiceNow Wiki
REST API Explorer - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:59 AM
Thanks Chuck. I was expecting the same but still wanted to check.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 08:59 AM
If I have answered your question, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.
If you are viewing this from the community inbox you will not see the correct answer button. If so, please review How to Mark Answers Correct From Inbox View.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2017 09:07 AM
Check below available error objects. But yes as stated by Chuck doing so could cause serious problems with other integrations.
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy