Importing data from 3rd party REST API without IntegrationHub
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2022 03:56 AM
Hi,
I'd like to know how I'd be able to import data from a third party tool that provides a REST API, without IntegrationHub. Basically, I expected to be able to define a REST message with a GET method, which returns some data, which in turn gets inserted into an import set and transformed from there.
I have checked a few places in ServiceNow, the only way I could possibly think of is to create a data source with type "Custom (Load by Script)", where I'd execute the REST messsage GET and map the response to import set fields - but is this really the ideal way to do it?
Thanks for your help,
Max
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2022 04:11 AM
Create a import set table (extend it by import set row table).
Create transform map for that.
Create a REST message to make the API call and define GET. Use the Preview Script Usage related link to copy the script to invoke the API
create a scheduled job to invoke the REST API using the script copied above.
Best practice is rest api invocation should happen from Script INclude. Call the script include from the scheduled job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2022 07:35 AM
Hey Suvro,
Thanks for your answer. I guess in the script include which invokes the rest message, I would then parse and traverse the response JSON, and initialize new records in my import set table via gliderecord.initialize() for every record that gets returned in my API call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2022 09:49 PM
Yes You are correct