Hello,
I am currently working on a project that involves making a script to change some config values on a Sophos UTM 9 device and I can't seem to make it work.
My main issue is that I keep getting the code 401 (unauthorized) even though I have double checked the API key and tried everything to make it work somehow.
This is what the code currently looks like:
import requests
import base64
token = "<token>"
token64 = base64.b64encode(token.encode('ascii'))
url = "<url>:4444/api/objects/network/network/"
headers = {
'Accept': 'text/json',
'X-RESTD-SESSION': 'close',
'Authorization': 'Basic:'+token64.decode('ascii')
}
response = requests.request("GET", url, headers=headers)
print(response)
This thread was automatically locked due to age.