12-16-2020 09:36 AM
>>> 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.
12-16-2020 10:16 AM
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
12-17-2020 11:28 AM
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"}]}'
>>>
12-18-2020 07:59 AM
12-18-2020 11:51 AM
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 >>>
12-18-2020 02:36 PM
yeah looks like there is a permissions issue .. please contact API support to check further - supportapis-help@cisco.com
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide