Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dell API: Warranty Information
#!/usr/bin/env python
# Quick script to check your Dell asset's warranty status
# Just drop your service tag as parameters for the script and go.
import sys
import requests
APIKEY = 'd676cf6e1e0ceb8fd14e8cb69acd812d'
URL = 'https://api.dell.com/support/v2/assetinfo/warranty/tags.json?svctags={0}&apikey=' + APIKEY
def get_warr_from_dell(svctag):
res = requests.get(URL.format(svctag))
if res.status_code != 200:
sys.stderr.write('[%s] Caught %i as the response code.\n' % (svctag, res.status_code))
sys.stderr.write('[%s] Unable to get details for given service tag.\n'
% svctag)
return False
fault = res.json['GetAssetWarrantyResponse']['GetAssetWarrantyResult']['Faults']
if fault is not None:
sys.stderr.write("[%s] Failed to find details. Sure it's a valid TAG?\n" % svctag )
return False
asset = res.json['GetAssetWarrantyResponse']['GetAssetWarrantyResult']['Response']['DellAsset']
model = asset['MachineDescription']
ent = asset['Warranties']['Warranty']
shipped = asset['ShipDate']
print 'Service Tag: ', svctag
print ' Model: ', model
print ' Shipped: ', shipped, '\n'
print '{0:<20} {1:>15}'.format(*('Warranty Ends','ServiceLevelDescription'))
for warr in [(d['EndDate'],d['ServiceLevelDescription']) for d in ent]:
print '{0:<20} {1:>15}'.format(*warr)
if __name__ == '__main__':
get_warr_from_dell(sys.argv[1])
sys.exit()
@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Apr 12, 2018

How to apply apiKey

@Ezerbeth

This comment has been minimized.

Copy link

@Ezerbeth Ezerbeth commented Jul 16, 2018

Go to https://developer.dell.com/, create a key, and wait forever for them to approve it. I requested mine over 2 months ago, contacted them twice and got nothing. Dell is such a terrible company.

@sterlingmd17

This comment has been minimized.

Copy link

@sterlingmd17 sterlingmd17 commented Nov 16, 2018

THANK YOU. Making me look like a genius for my workplace 👍

@ShortArrow

This comment has been minimized.

Copy link

@ShortArrow ShortArrow commented Jan 14, 2020

I can't access "https://developer.dell.com/".
how can i break this situation?

NET::ERR_CERT_AUTHORITY_INVALID
Subject: developer.dell.com
Issuer: Dell Technologies Issuing CA 101
Expires on: 2021/08/21
Current date: 2020/01/14

@moirisca

This comment has been minimized.

Copy link

@moirisca moirisca commented Jan 25, 2020

still on certificate problems, website cant be reached...
same for other sites like myconnect-emea.dell.com
they can make some good servers, but they have no fucking clue on to configure them... LOL

  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
  • Server certificate:
  •    subject: C=US; ST=Texas; L=Round Rock; O=Dell USA L.P.; OU=Information Technology; CN=developer.dell.com
    
  •    start date: 2019-08-21 19:37:31 GMT
    
  •    expire date: 2021-08-20 19:37:31 GMT
    
  •    issuer: C=US; ST=Texas; L=Round Rock; O=Dell Technologies; CN=Dell Technologies Issuing CA 101
    
  •    SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment