How to trigger Outbound GET REST API if there is an Inbound call

Mrman
Tera Guru

Hi All,

My use case requires to call external REST API from ServiceNow and the get additional field details when that External system makes a call to  ServiceNow by passing some basic details of the user.  For example, the 3rd party system trigger a call to Service Now when they hire a new candidate in their system and pushes the ID of that user.  Once the initial call is made, based on that User ID they pass we need to go and GET the additional field details like their First name , last name , email, etc...and store in a table.

Please let me know possible solutions to achieve this in Service Now using REST API and our 3rd party system supports REST API with JSON.

 

@Ankur Bawiskar 

1 ACCEPTED SOLUTION

Hi,

Example

1) create scripted REST API in instance B

2) now instance A will call that

3) in the scripted REST API created in instance B do whatever processing you want

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

14 REPLIES 14

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can create Scripted REST API

1) 3rd party would consume it and send the user details in JSON format

2) once it reaches ServiceNow you can do your processing i.e. invoke some other API if you wish

OR

you can also invoke that API using after insert BR on sys_user table if they are going to create users.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks @Ankur Bawiskar  for tour response .

Please let me know if I can call another REST message using GET method from the initial Scripted REST API whenever 3rd party call it and once we get response can I parse that JSON and process it for submitting a record producer ?

Hi,

why not.

yes in Scripted REST API you can call another API, parse and do processing and submit record producer

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Thanks , for testing can I try this scenario between two Service Now instances. Like one instance pushing the ID initially to another instance and then based on that other ID other instance invoke GET call .

Will creating the Scripted API in the First instance work ?