Requests API

Con risposta


Data ultimo post: 03 nov 2021

Hi,

I'm trying to post a new request to the api/v2/requests.json endpoint.

Basically I'm trying to follow along with this guide: https://developer.zendesk.com/documentation/ticketing/managing-tickets/building-a-custom-ticket-form-with-the-zendesk-api/#create-the-tickets

With the exception that I'm using Axios for POST requests and I'm in a node.js environment.

Currently, I'm trying to post data that looks like this:

{"request":{"subject":"Support Request from Teddy Michels","comment":{"body":"Hey there."}}}

But I'm getting a 422 back. Specifically, error.response.data.details reads:

{
email: [ { description: 'Email: cannot be blank', error: 'BlankValue' } ]
}

I've added email to the request object, but that doesn't seem to help anything. What specifically is this error referring to? I don't see anything about it in the docs.

For what it's worth, my request headers also contain:

'Authorization': 'teddy@doubledayandcartwright.com/token:APITokenHere'

Thanks in advance,

Teddy

UPDATE 11/4/2021

It appears that this issue was related to trying to send the request with an email that wasn't yet a registered user.

I was able to solve it by using a single agent email with the API token.


0

1

1 commento

Hi Teddy Michels,

Glad you managed to get it working! 

Another method that could work depending on your circumstances would be including a requester object containing email and name properties:

https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-requests/#create-request

Have a great day!

Tipene

0


Accedi per lasciare un commento.

Non hai trovato quello che cerchi?

Nuovo post