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

while adding new network device to DNAC response received forbidden

nnelluri
Cisco Employee
Cisco Employee

Hi Team,

 

while adding new network device via POST to the DNAC sandbox , Response received as below.

please advice how to resolve the Issue

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

 

please check sample code below.

token = get_token()
headers = {"Content-Type":"application/json","X-Auth-Token": token}
payload = {
"ipAddress": ["192.168.23.34"],
"snmpVersion": "v2",
"snmpROCommunity": "readonly",
"snmpRWCommunity": "readwrite",
"snmpRetry": "1",
"snmpTimeout": "60",
"cliTransport": "ssh",
"userName": "Loluwa",
"password": "lolu123!",
"enablePassword": "lolu123456",
}
auth_resp = requests.post(f"{api_path}/intent/api/v1/network-device",
json = payload,
headers = headers,
)
 
Thanks
Narasimha.
0 Replies 0