Store/Save inbound REST calls into a custom transaction log table instead of going through the Node Logs

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 01:09 PM
Is there a way to capture/insert the Inbound REST transaction immediately into a custom table when it gets invoked...
I would rather have everything in one table to look at and report, than going to the Node log File or Browser to search for transactions which is a significant effort to debug integrations.
Let me know if any thoughts or existing solutions or if there is something already available that I am missing.
Thanks in advance for the help.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 01:13 PM
Hi Kartik,
You have these tables where you can track all the transactions:
syslog_transaction
ecc_queue
Or just create logs and use the System Log table.
Hope this helps,
Pedro Lopez

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 01:50 PM
Yes you can create a custom table and create a script include to do the gliderecord insert with the request, response payloads and status code as parameters passed to that script include. You can then call that script include in scripts where you are triggering the outbound calls or put it in a scripted api for inbound calls

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 02:00 PM
Yes. But how can that logic be used for inbound calls when I am using a standard end point like:
https://XYZ.service-now.com/api/now/table/incident
or
https://XYZ.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2019 02:10 PM
https://XYZ.service-now.com/api/now/table/incident-- this is a table api and we do not have control on the request and response going out. You will not be able to capture these table api requests.
https://XYZ.service-now.com/api/sn_sc/servicecatalog/items/{sys_id}/order_now
This is a scripted rest api. Navigate to scripted rest api in your instance s and look for service catalog api. Once you open that record, you will see Buy Item method and you can add the logic of inserting a record in to a tracking table in the script section