POST https://{URL}.zendesk.com/api/v2/tickets.json net::ERR_ABORTED 401 | Community
Skip to main content

POST https://{URL}.zendesk.com/api/v2/tickets.json net::ERR_ABORTED 401

  • March 10, 2022
  • 1 reply
  • 0 views

Hello, I am attempting to POST a ticket to our ticket queue using the Zendesk API. I keep receiving a 401 error with minimal feedback as to what the issue could be.

async function postData(url: string, data: object) {
constresponse=awaitfetch(url, {
method: 'POST',
mode: 'no-cors',
body: JSON.stringify(data),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Basic {BASE64EMAIL/PASSWORD}'
}
});
}
I have been able to get the username and password to work over curl as well as the email and an API token.

1 reply

Eric27
  • March 14, 2022
Hey Mitchell,

Would you mind if we move this into a ticket so we can pull logs? Thanks!