13

Creating a ticket with requester as submitter through the v2 API

Hi,

 

Previously we sent support tickets to Zendesk via email by forging the "From"-field to the original requestor. This resulted in a submitter AND the requestor being the same. This was nice since the Zendesk email notifications were from the original requestor and the emails showed relevant information in the From field.

Now, since the email delivery was unreliable, we decided to move to the Zendesk REST API.

However,

curl https://subdomain.zendesk.com/api/v2/tickets.json \
-d "{\"ticket\":{\"subject\":\"TEST TICKET\",\"requester\":{\"name\":\"John Doe\",\"email\":\"somebody@gmail.com\"}, \"description\":\"TEST TICKET\nby John\"}}" \
-H "Content-Type: application/json" \
-v -u agentemail/token:apitoken

creates a ticket which has requestor as somebody@gmail.com, but submitter as "agentemail". We have now tons of notification emails from the 'agentemail'.

AND:

curl https://subdomain.zendesk.com/api/v2/tickets.json \
-d "{\"ticket\":{\"subject\":\"TEST TICKET\",\"requester\":{\"name\":\"John Doe\",\"email\":\"somebody@gmail.com\"}, \"description\":\"TEST TICKET\nby John\"}}" \
-H "Content-Type: application/json" \
-H "X-On-Behalf-Of: somebody@gmail.com" \
-v -u agentemail/token:apitoken

fails as 403 Forbidden.

The question is, how to get the same requestor as the submitter of the ticket through the API when creating a new ticket on behalf of user that we don't know if he/she exists yet?

 

Best,

  • Ville

 

12 comments

Please sign in to leave a comment.