I'm running a static site seperate to my zendesk account in which we are trying to create anonymous tickets.
I'm using a Cloudflare worker to send these requests and per the docs, I'm calling the https://<mydomain>.zendesk.com/api/v2/requests url which shouldn't need any authentication from my understanding according to these docs:
https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-requests/
I'm also sending the Bearer token header from a generated API token (confirmed correct).
I keep encountering a 401 Unauthorized error when sending a payload, even the payload specified in the docs:
{"request": {"requester": {"name": "Anonymous customer"}, "subject": "Help!", "comment": {"body": "My printer is on fire!" }}}
If I send NO payload, I get a 200 OK status, which suggests the data is maybe malformed but I've tried various versions of this.
I thought it may be a CORS issue but I've set it to both the domain I'm sending to and to allow all ("*") for testing and still can't create an anonymous ticket from a different domain.
Any help would be appreciated.