The script will print warranty info for a Dell PC to the screen and save to the $response variable. It is modified to minimize the number of times it needs to generate new access tokens and to make it easier to use. This PowerShell script is a modified version of the one form the reddit post. It would be intesting to do this in Python or Bash for use on Linux, but since most Dell PCs at most organization run Windows, PowerShell seems like a good place to start. This can be done in any programming lanuage. The old method doesn’t work anymore! To programatically pull warranty info from Dell we need to first generate the access token and then use it to do a get request against a Dell URL. Dell started useing OAuth 2.0 in December 2019, so there are still alot of code examples out there that use the old method, which was just adding your service tag and API in the correct format at the end of a URL. Dell discourages customers from generating more access tokens than needed, so we want our script to use the same token as long as it is valid. After one hour you can just repeat the authentication process with your key and secret to get a new access token. Both need to be used together with OAuth 2.0 to produce an access token that last for one hour. Hours of Googleing found only non-working code examples! Finally, I found this reddit post that explains it well: īasically, what Dell provides is two things: an API key and a key secret. Dell TechDirect customers can request access to the Dell API which can be used to programatically lookup warranty information–no clicking through a captcha! See: Īctually using the key that Dell provides is not as straight forward.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |