Is there a way to know who use a Scripted REST API ?

lucap_
Mega Sage

Hi, I've created a Scripted REST API beacause of a user need to get some records from a table.
I whould like to know if there is a way to know when this user use the Scripted REST API resource (GET). I saw the sys_api_stats table, but I whould like to know if there is something more specific, like a staging table for the incoming SOAP messages.

Best regards

Luca

1 ACCEPTED SOLUTION

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Yes, you can go to Transaction Log and see there each transaction, like in screenshot below:



Screen Shot 2017-03-29 at 10.18.10 AM.png


View solution in original post

8 REPLIES 8

sergiu_panaite
ServiceNow Employee
ServiceNow Employee

Yes, you can go to Transaction Log and see there each transaction, like in screenshot below:



Screen Shot 2017-03-29 at 10.18.10 AM.png


Thanks Sergiu,


Is there on this syslog_transaction a field that to the parameters used and the response given from the system?



Thanks


Luca


The response is not present, and as for parameters you can only see the main URL.


But, this transaction is inserted into the syslog_transaction table only when it finished, which means it was processed.


Hello,


I need to create a Webservice API where input is: Sys ID of any record and output is: all *related* active records to that sys id. The relationships between the tables is maintained in Relationships under system definition.


Could you please guide me how to implement this? Sample code would be great.


Input: Sys ID of the record
Output: All *RELATED* active records from *VARIOUS* tables (in the following JSON format):
{
"result": [
{
"Sys ID": "5520267",
"CI Name": "Record 1",
"Table Name": "u_table_a"
},
{
"Sys ID": "5520367",
"CI Name": "Record 2",
"Table Name": "u_table_a"
},
{
"Sys ID": "8331210",
"CI Name": "Record 1",
"Table Name": "u_table_b"
},
{
"Sys ID": "8321210",
"CI Name": "Record 2",
"Table Name": "u_table_b"
},
{
"Sys ID": "3042006",
"CI Name": "Record 3",
"Table Name": "u_table_b"
},
{
"Sys ID": "4509847",
"CI Name": "Record 1",
"Table Name": ""u_table_c"
}
{
"Sys ID": "4509247",
"CI Name": "Record 2",
"Table Name": ""u_table_c"
}
]
}