Scripted REST API - How to send 404 http error code response for url with wrong endpoint in scripted rest api?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2021 01:23 AM
Hi,
I want to return 404 HTTP status code when user enters url with wrong endpoint for a Scripted REST API.
eg: Correct url: "https://<instance.service-now.com>/api/name_space/correct_endpoint".
Incorrect url: "https://<instance.service-now.com>/api/name_space/wrong_endpoint" should return 404 HTTP status code.
I am getting HTTP status code 400 now.
Any suggestions?
Thanks,
Leo
Labels:
- Labels:
-
Scripting and Coding
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2021 05:29 AM
Not possible from ServiceNow.
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader