cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1311
Views
0
Helpful
5
Replies

Unable to retrieve EOX API Information.

hooversciscotac
Level 1
Level 1
>>> import requests
>>> auth_url = "https://cloudsso.cisco.com/as/token.oauth2"
>>> auth_header = {
... "client_id": "**omitted**",
... "client_secret": "**omitted**"",
... "grant_type": "client_credentials"
... }
>>> response = requests.post(auth_url, params=auth_header)
>>> token = response.json()
>>> token
{'access_token': '**omitted**"', 'token_type': 'Bearer', 'expires_in': 3599}
>>> http_auth_header = {
... "Accept": "application/json",
... "Authorization": "%s %s" % (token['token_type'],
... token['access_token']),
... }
>>>
>>> call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/4/EOXBySerialNumber/1/**omitted**"?responseencoding=json", headers=http_auth_header)
>>> call.text
'<h1>Not Authorized</h1>'

>>> call.status_code
403

Hello, 

 

Apologies if this is not the correct place for this but i am relatively new to DevNet.

I am trying to integrate with the EOX Api to retrieve EOS/EOL dates for some of our cisco hardware.

I followed the documentation steps and have signed up a new application in the apiconsole and have gotten a client_id/secret.

 

 

Any help would be greatly appreciated.

5 Replies 5

dstaudt
Cisco Employee
Cisco Employee

I understand certain contracts must be in place between partner/customer orgs for entitlement to this API - might doublecheck the requirements/steps here: https://developer.cisco.com/docs/support-apis/#!user-onboarding-process

 

If that seems ok, suggest contacting the API support team directly so they can look at the details of your account: https://developer.cisco.com/docs/support-apis/#!support

omz
VIP Alumni
VIP Alumni

Hi

 

https://developer.cisco.com/docs/support-apis/#!eox/get-eox-by-serial-numbers

https://api.cisco.com/supporttools/eox/rest/5/EOXBySerialNumber/{pageIndex}/{serialNumber}

In your call .. there is extra " .. I guess added when omitted the serial. Not a problem coz you would get syntax error 

>>> call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/4/EOXBySerialNumber/1/**omitted**"?responseencoding=json", headers=http_auth_header)

Try this - 

call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/4/EOXBySerialNumber/1/FCW2140L039?responseencoding=json", headers=http_auth_header)
>>> call.text
'<h1>Not Authorized</h1>'
>>>

>>> call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/5/EOXBySerialNumber/1/FCW2140L039?responseencoding=json", headers=http_auth_header)
>>> call.text
'{"PaginationResponseRecord":{"PageIndex":1,"LastIndex":1,"TotalRecords":1,"PageRecords":1},"EOXRecord":[{"EOLProductID":"","ProductIDDescription":"","ProductBulletinNumber":"","LinkToProductBulletinURL":"","EOXExternalAnnouncementDate":{"value":"","dateFormat":null},"EndOfSaleDate":{"value":"","dateFormat":null},"EndOfSWMaintenanceReleases":{"value":"","dateFormat":null},"EndOfRoutineFailureAnalysisDate":{"value":"","dateFormat":null},"EndOfServiceContractRenewal":{"value":"","dateFormat":null},"LastDateOfSupport":{"value":"","dateFormat":null},"EndOfSvcAttachDate":{"value":"","dateFormat":null},"UpdatedTimeStamp":{"value":"","dateFormat":null},"EOXError":{"ErrorID":"SSA_ERR_026","ErrorDescription":"EOX information does not exist for the following product ID(s): C9300-24UX-A","ErrorDataType":"PRODUCT_ID","ErrorDataValue":"C9300-24UX-A"},"EOXMigrationDetails":{"PIDActiveFlag":"","MigrationInformation":"","MigrationOption":"","MigrationProductId":"","MigrationProductName":"","MigrationStrategy":"","MigrationProductInfoURL":""},"EOXInputType":"ShowEOXBySerialNumber","EOXInputValue":"FCW2140L039"}]}'
>>>

Same error:

>>> call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/5/EOXBySerialNumber/1/FCW2140L039?responseencoding=json", headers=http_auth_header)
>>> call.text
'

Not Authorized

'

Im thinking there must be something wrong with the token permissions, i cannot even do a lookup by product id:

 

>>> import requests
>>> import json
>>> 
>>> auth_url = "https://cloudsso.cisco.com/as/token.oauth2"
>>> auth_header = {
...     "client_id": "***",
...     "client_secret": "***",
...     "grant_type": "client_credentials"
... }
>>> response = requests.post(auth_url, params=auth_header)
>>> token = response.json()
>>> token
{'access_token': '***', 'token_type': 'Bearer', 'expires_in': 3599}
>>> 
>>> http_auth_header = {
... "Accept": "application/json",
... "Authorization": "%s %s" % (token['token_type'],
... token['access_token']),
... }
>>> call = requests.get(url="https://api.cisco.com/supporttools/eox/rest/5/EOXByProductID/1/WIC-1T=?responseencoding=json", headers=http_auth_header)
>>> call.text
'<h1>Not Authorized</h1>'
>>> call.status_code
403
>>> 

yeah looks like there is a permissions issue .. please contact API support to check further - supportapis-help@cisco.com

 https://developer.cisco.com/docs/support-apis/#!support