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

DNAC Sandbox 'Role does not have valid permissions to access the API'

Hi Guys,

I am trying to get over the exercises of DataKnox (CBT) for the DNAC Center.

But in many of them I am getting the following error.

403

'{"message":"Role does not have valid permissions to access the API"}\n'

for instance in the cli_runner

I am using the DNA Sandbox from Cisco.

 

base_url = "https://sandboxdnac2.cisco.com/dna"
auth_endpoint = "/system/api/v1/auth/token"

username = 'devnetuser'
password = 'Cisco123!'

auth_headers = {
    "Content-Type": "application/json",
    "Accept": "application/json"
}

auth_response = requests.post(url=f"{base_url}{auth_endpoint}", auth=(
    username, password), headers=auth_headers, verify=False).json()

Is there a way I can complete the exercises?

 

Please let me know.

 

1 Reply 1

omba
Level 1
Level 1

I am doing this for people who would find this post would be expecting an answer at the bottom.
"Which sandbox? Please note, most always on sandbox are read only and do not support POST requests.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io"
This was said by @bigevilbeard on https://community.cisco.com/t5/devnet-sandbox/rest-api-post-action-permission-issue/m-p/5089995#M9945
Cheers,