osTicket API: create a new ticket in python
The header key should be "X-API-Key"
and not "API-Key"
.
From osTicket API
page:
HTTP Access
Access to the HTTP API is restricted to valid API keys. An X-API-Key
HTTP header must be sent to indicate which API key is to be used with
the request.
The API key must match the remote IP of the connected
HTTP client. The remote IP is checked as usual. If the osTicket server
is sitting behind a reverse proxy, the original IP of the client will
be retrieved from the X-Forwarded-For header, if provided by your
proxy.Example:
X-API-Key: BA00B76BAA30F62E1940B46CC1C3C73C
Command line Example with Curl:
curl -d "{}" -H "X-API-Key: BA00B76BAA30F62E1940B46CC1C3C73C" https://support.you.tld/api/tickets.json
Read more here: Source link