cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
528
Views
0
Helpful
1
Replies

Authorization CISCO API Software Suggestion

andreslgx_101
Level 1
Level 1

Hi Everybody, 

 

Anyone has gotten access to the Rest API to Software Suggestion:

 

https://api.cisco.com/software/suggestion/v2/suggestions/software/productIds/{productIds}

 

I dont know exactly what we must put on the authorization header (Basic Auth, Bearer token, Oath2 etc) and the documention is not very clear. Thanks for your help. 

 

https://developer.cisco.com/docs/support-apis/#!software-suggestion/get-suggested-releases-and-images-by-product-ids

1 Reply 1

nunoandre
Level 1
Level 1

It's OAuth2, the client credentials flow.

 

You've got to send your Cisco API Console client credentials in a POST to https://cloudsso.cisco.com/as/token.oauth2 with the following payload:

{"client_id": <client_id>, "client_secret": <secrtet>, "grant_type": "client_credentials"}

You'll receive a response like:

 {"access_token": "i9BIwm6tTKXkAhmCtaVzbSK2J", "token_type": "Bearer'", "expires_in": 3599}

You only have to add the token to your requests headers:

{"Authorization": "Bearer i9BIwm6tTKXkAhmCtaVzbSK2J"}