How to script a scheduled job to pull warranty information (end_date) from a site and update our assets with the new warranty info?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2020 02:44 PM
Hi,
We have a table in our Service Now environment that contain info about assets we scan for using CMDB. We are looking to created a scheduled job that checks all the assets where the warranty end date is blank. And if blank, goes to the Lenovo warranty site and retrieves the warranty end date and inserts into the specific asset.
We have a good idea how to query the table, check for specific blank records, and then loop through these blank records. We are just looking for help on the best way to reach a site and pull values from that page.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2020 07:00 PM
You will need to get client id from Lenevo once you get it you can use below API to get that info
https://supportapi.lenovo.com/v2.5/Warranty?Serial=XXXXX
API Doc - https://supportapi.lenovo.com/Documentation/Index.html
Your Lenevo Account Rep can help you with client id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2020 08:29 PM
You may check if there is REST API documentation available for the Lenovo Warranty site. Most probably the site URI will be accessible using REST-based query. In that case, the process will be as follows -
1. you create a scheduled job (scripted REST Service) that will periodically send a REST query to Lenovo Warranty Site. The query must include the Lenovo Serial Number as one of the parameters.
2. If the query executes successfully, (Serial Number is found on the Warranty table) the remote server (the Warranty Site host) will return a response.
3. You parse the response and extract the relevant details (for example, the end_date).
In providing the suggestion above, I assume that you are familiar with scripted REST web-service in ServiceNow.