Hi, Thank you for sharing these videos on Scripted REST API in ServiceNow, the entire playlist is brilliant! I was creating a similar POST request with an app I developed in ServiceNow and I was wondering if there is a way to handle business rules output in the rest script. Essentially, I don't want to allow users to create a record if the mandatory fields in the table are not filled out and, as of now, I just have a business rule set up to perform this check. Would you know if there are any best practices to implement input controls for the scripted API in ServiceNow?
In this video we are creating the API to accept incoming requests. I think what you are asking about is posting to an external API. In that case, you need to refer to the documentation for that API to understand the requirements for the request. What format(s) is permitted (JSON, XML)? What parameters must be included? Etc. If you want to create a GET/POST/etc. request from ServiceNow to an external API, you need to build the request under System Web Services > Outbound > REST Message. Hope this helps.
Hi,
Thank you for sharing these videos on Scripted REST API in ServiceNow, the entire playlist is brilliant!
I was creating a similar POST request with an app I developed in ServiceNow and I was wondering if there is a way to handle business rules output in the rest script.
Essentially, I don't want to allow users to create a record if the mandatory fields in the table are not filled out and, as of now, I just have a business rule set up to perform this check.
Would you know if there are any best practices to implement input controls for the scripted API in ServiceNow?
Why handling business rules in rest script while you can handle rest script in business rules 😆
Thank you for the video! Would this also work if you want to post to an API endpoint outside of Servicenow? Or would that work differently?
In this video we are creating the API to accept incoming requests. I think what you are asking about is posting to an external API. In that case, you need to refer to the documentation for that API to understand the requirements for the request. What format(s) is permitted (JSON, XML)? What parameters must be included? Etc. If you want to create a GET/POST/etc. request from ServiceNow to an external API, you need to build the request under System Web Services > Outbound > REST Message. Hope this helps.
This scripted rest API out how to use in flow design and test