API to query sc_req_item, sc_task

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 06:00 AM
Hi Team ,
We have a request to create API to query sc_req_item and sc_task table based on following fields,
should I use OOB API or scripted rest messages(if the response body needs to be changed)?
any update on this would be much appreciated.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 06:07 AM
Hello,
It depends on the requirement.
If you have all the fields directly available on the sc_req_item and sc_task, then you can use the simple OOB API.
But if you have complex conditions then you can go for Scripted rest API.
Also Scripted rest API gives you more control in regards to the output. It is also easier to amke changes in the future and from maintenance point of view.
Please mark answer correct/helpful based on Impact
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 06:25 AM
Hi,
You can use the API with below 3 options.
1. Table API - use direct table and generate the end point.
2. Import Set API - Create import set for mentioned table and generate the end point.
3. REST API - Create the custom REST API and generate the end point.
1st option is not recommendable. 2 and 3 is advisable. If required business related custom response message you select the Custom REST API else you can go with Import Set API and End Point.
Please mark as correct answer / helpful if helped.
Regards,
Suresh.
Suresh.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 07:27 AM
do we have any oob api to query service catalog request item and catalog task based on certain fields and item variables? if not , I need to go with scripted rest api right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 07:34 AM
Hello Feddy,
As I had mentioned in my answer it depends on the requirement
For your case you can easily create an OOB API from rest API explorer for both the tables.
But in the longer run it is advised you use Scripted rest API. So I would suggest go with Scripted rest API.
But if in your project other developers use the OOB setup more frequently then you may use that.
Thanks.
Please mark answer correct/helpful based on Impact