Mel_339767
Nov 09, 2017Nimbostratus
What kind of account do I need to access the REST API?
I'm having issues in accessing the API, I think. I got Error 401 whenever I use my credentials that I believe has admin privileges already. Is there a way to access the API without using the "admin" account?
Edit: How do I check if my account has admin privileges?
Below is my code:
import requests
requests.packages.urllib3.disable_warnings()
uname = 'myaccount'
pw = 'mypassword'
req = requests.session()
req.auth = (uname, pw)
req.verify = False
req.headers.update({'Content-Type': 'application/json'})
uri = 'https://[host]/mgmt/tm/ltm'
response = req.get(uri)
print(response.text)
Result: {"code":401,"message":"Authorization failed: user= resource=/mgmt/tm/ltm verb=GET......."}