- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2021 06:44 AM
Hello. I am using the REST API to create and submit requests.
In some cases, I will be creating several 100 requests containing multiple items that needs different approvals. Instead of having each person manually approve each item, is it possible to push them through the workflow / Approve them using the REST API ?
All help is appreciated!
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2021 07:02 AM
Hi GloriousWater,
Hope yiou are doing well.
This is an intresting requirement.
Yes you can definately create a scripted rest api to approve the records but You would update the sysapproval_approver record. The trick becomes authenticating who is doing this. REST integrations typically don't come from a user, they come from a service account, so all approvals are done by the same person. From an audit perspective, this is a bad idea.
Steps:
- Go to REST API explorer
- select the table as sysapproval_approver
- Use the PAtch API
- Provide the payload as given in below :
{"state":"approved/rejected","approver":"sys_id of approver"}
Please mark correct if it helped.
Regards,
Amit Gujarathi
(Technomonk)
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2021 06:53 AM
Hi,
you can use OOB Table API on Approval table for approving/rejecting the records.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2021 07:02 AM
Hi GloriousWater,
Hope yiou are doing well.
This is an intresting requirement.
Yes you can definately create a scripted rest api to approve the records but You would update the sysapproval_approver record. The trick becomes authenticating who is doing this. REST integrations typically don't come from a user, they come from a service account, so all approvals are done by the same person. From an audit perspective, this is a bad idea.
Steps:
- Go to REST API explorer
- select the table as sysapproval_approver
- Use the PAtch API
- Provide the payload as given in below :
{"state":"approved/rejected","approver":"sys_id of approver"}
Please mark correct if it helped.
Regards,
Amit Gujarathi
(Technomonk)
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-09-2021 07:57 AM
Thanks 🙂
Using the ODBC driver to extract information on specific request / items and then providing people with a list where they can quickly check if something is to be approved or not and then just read it in through the api to approve w/e needs approval. gonna save them quite a bit of clicking.
For the audit issue, i suppose i can grant my users rest api roles and then create a script where they provide their credentials when running it. (Without credentials being saved in the script).