I'm attempting to create a ticket using Python and the API. I've created a token and assigned it to the IP address of my workstation, yet I keep getting a 401 'Valid API key required' error. The system logs are showing that the error is coming from the IP I assigned the token too as well.
`import requests
class BearerAuth(requests.auth.AuthBase):
def init(self, token):
self.token = token
def call(self, r):
r.headers["authorization"] = "Bearer " + self.token
return r
url = 'http://support.domain.com/api/http.php/tickets.json'
data = { "alert": True, "autorespond": True, "source": "API", "name": "Angry User", "email": "apitest@domain.com", "phone": "3185558634X123", "subject": "Testing API", "ip": "111.222.111.222", "message": "data:text/html,MESSAGE <b>HERE</b>"}
r = requests.post(url, data=data,auth=BearerAuth('token'))
print(r)`
