cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2740
Views
1
Helpful
3
Replies

grant_type is required - error in Smart+Connected Digital Platform Sandbox

Allan Alfonso
Cisco Employee
Cisco Employee

Hi,

I get the following error when trying to request access tokens.

{

  "error_description": "grant_type is required",

  "error": "invalid_request"

}

According to the instructions in the following link:

Smart+Connected Digital Platform API Overview - Authentication and API Access using Python

https://devnetsandbox.cisco.com/sandbox-instructions/Digital_Platform/cdp-devnet-python.pdf

There are five pieces of information that must be passed to the Authentication API:

1. Username (username) - This is the email address of the user logging in to the Smart+Connected Digital Platform API Steps Step 1: Using the Smart+Connected Digital Platform Authentication API to request access tokens

2. Password (password) - This is the password associated with the username

3. Client Secret (client_secret) - This is the shared secret used by your application

4. Client ID (client_id) - This is the unique id for your application

5. Authorization Type (grant_type) - This will be set to 'client_credentials' for Smart+Connected Digital Platform API authentication For DevNet, these will be provided to you. For Smart+Connected Digital Platform Deployments, these can be obtained from the Smart+Connected Digital Platform Portal

I tried setting grant_type to 'client_credentials'. This did not work. I set grant_type to blank. This did not work. I removed grant_type. This did not work either. The documentation says that for DevNet, this parameter will be provided but there was no parameter provided in the setup email. Only the first 4 parameters are sent.

Can someone please clarify to get this working so we can get the access tokens?

3 Replies 3

zowu
Cisco Employee
Cisco Employee

Hi Allan,

Could you please show us which CDP server you are talking with? An active sandbox lab reservation required and the CDP server should be 10.10.20.6 other than cdp-dmz.cisco.com.

We've just tried the sample Python script w/ credential provided within one active reservation and it is working here.

Please let us know if any further assistance required.

Thanks,

Bob

Hi,

Here is a screenshot from POSTMAN. I have an active reservation and a VPN connection to the sandbox. I am using 10.10.20.6. I am using the credentials that were emailed to me. grant_type is set to 'client_credential'. I also tried it without a grant_type parameter. Can someone try it with POSTMAN? In parallel, I can try the python script but the python script is passing the same parameters so I'm not sure why it's not working with POSTMAN. The results should be consistent.

Screen Shot 2017-02-13 at 10.27.19 AM.png

Screen Shot 2017-02-13 at 10.27.32 AM.png

Screen Shot 2017-02-09 at 4.52.00 PM.png

Hi Allan,

The params should be enclosed in the "body" part other than "headers" within Postman. And here is my Postman settings and it does get response as we did it using Python code:

1.png

Regards,

Bob