Running a REST query to populate a table

jshatney
Mega Expert

In the process of setting up an integration between a 3rd party CMDB and ServiceNow.   They have provided a REST API to query their database.
I have used both SOAP and REST queries in the past to pull specific data on demand and use it, but in this case, I'm looking to take the response and put it into a data source so that I can transform it into the CMDB.

 

Does anyone have any suggestions for the following:


1. Where should the REST messages be called from?   I was thinking a scheduled job since it does not need to be on demand.

2. What method should I use to take the response and write that to a table?

3. Where should I store the response form the REST message so that I can run a transform against it and populate various cmdb tables?   I was thinking for servers and computers, I could use the imp_computer table and utilize the transform script (with some adjustments) that already exists.

 

Thanks for your input.


27 REPLIES 27

Matthew - Thank you for posting this information.   It was very helpful in setting up our integration with Casper.



Rick


HI there, What resource are you querying with your GET request?



What is the request URL?



Is this the correct request url?



../JSSResource/computerinventorycollection


Hi kda,


the URL i use is
/JSSResource/computers/subset/basic



Once you get the basic information, and get the Unique ID from Casper , you can run another REST API to get more specific information abou the system (such as disc, software, network adapter and so on.



Let me know if that helps.





Frank


Thank you Frank. I would assume that your script is quite a bit different than what matthewsglen posted since it looks like he is pulling all from the same resource url (unless I am mistaken)?



What are you using for your Coalesce fields?


Hi kda,


i coalesce on the serial number in the transform map


Here is my script i am using in a scheduled job once a week.


Casper.JPG