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

Cant authenticate vManage API sandbox

MapleMagician
Level 1
Level 1

I'm getting the following error when trying to connect to the SDWAN sandbox via python...

 

Exception has occurred: ConnectionError
  •  
HTTPSConnectionPool(host='sandboxsdwan.cisco.com', port=8443): Max retries exceeded with url: /j_security_check (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000242865FB5B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
 
Judging by the error it seems like the URL may be wrong. I also tried using the creds shown in the sandbox: https://sandbox-sdwan-1.cisco.com. devnetuser/RG!_Yw919_83 and this did not work either.
 
Here is my code:
import requests
import json

auth_endpoint = "j_security_check"

login_body = {
    "j_username":"devnetuser",
    "j_password":"Cisco123!"
}

sesh = requests.session()
login_response = sesh.post(
    url=f"{base_url}{auth_endpoint}"data=login_bodyverify=False
)
 
What am I doing wrong?
1 Accepted Solution

Accepted Solutions

@MapleMagician try this code https://developer.cisco.com/codeexchange/github/repo/bigevilbeard/Getting_Started_SDWAN

With 19.2 (and later) vManage version, API authentication is enhanced to include token in the POST/PUT/DELETE request Headers.

 

You can follow this Learning Lab here  -- https://developer.cisco.com/learning/modules/sd-wan and the the API docs https://developer.cisco.com/docs/sdwan/

 

 

Hope this helps.

 

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

1 Reply 1

@MapleMagician try this code https://developer.cisco.com/codeexchange/github/repo/bigevilbeard/Getting_Started_SDWAN

With 19.2 (and later) vManage version, API authentication is enhanced to include token in the POST/PUT/DELETE request Headers.

 

You can follow this Learning Lab here  -- https://developer.cisco.com/learning/modules/sd-wan and the the API docs https://developer.cisco.com/docs/sdwan/

 

 

Hope this helps.

 

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io