Creating webhooks to interact with third-party systems

Return to top

61 Comments

  • Jacob Christensen
    Community Moderator

    Very exciting stuff!

    Testing this I was expecting to see an event in the ticket event log, for tickets where a trigger ran a webhook action, but it isn't. Is this deliberate?

    0
  • Jacquelyn Brewer
    Zendesk Documentation Team

    Hi Jacob. Thanks for your question. This is expected. Webhooks run in response to something else happening, such as a ticket event. The event that triggers the webhook to run might be captured in the ticket event log, but all of the webhook logging is captured in thewebhook activity logs.

    0
  • Jacob Christensen
    Community Moderator

    Thanks Jacquelyn. I get that the webhook specific logging is captured in thewebhook activity logs, but since a trigger is firing on a ticket event, I would expect to see that action logged on said ticket - like any other trigger would.

    2
  • Chris Hynes

    How do we reference the contextual ticket ID in the URL?

    With Targets, we are able to reference a ticket like this:

    https://ourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.json

    Which allows our automations to make updates to tickets. I don't see how to do this with the webhook model.

    9
  • Peter Hochstrasser

    @...

    Seconded...

    It looks as if the webhook URL is static at the moment.

    This would require to rewrite all these targets into applications using a third party server or create Zendesk Apps to serve the purpose.

    1
  • Nathan Gutauckas

    @...

    We are also using this same model to update tickets.

    Our use case: Each user has a custom field: "CC Email". When a ticket is created by that user, that add that CC to the ticket's email CCs. (ie. add your manager to your tickets)

    Right now our layout is: Trigger activates on update of ticket using JSON (PUT to email_ccs).
    Trigger notifies HTTPs targethttps://ourdomain.zendesk.com/api/v2/tickets/{{ticket.id}}.jsonto update the ticket.

    Looking to see how we can achieve this with webhooks. Thanks!

    2
  • Jason Brown

    I had the same question as Chris. I found that I could use the Update Many API endpoint and just pass a single ticket id. Placeholders are used in the Trigger JSON to set ticket ID.

    1
  • Maik Künnemann

    @...we use this targets, how can we do this with webhooks?

    /api/v2/tickets/{{ticket.id}}.json

    / api / v2 /票/ {{ticket.id}} /评论/ {{ticket.latest_comment.id}}/make_private

    3
  • Amber

    Is there a plan to enable the use of placeholders in the Endpoint URL before HTTP targets are deprecated?

    0
  • Peter Hochstrasser

    @...,@...

    Have a look at this article, and my comment:

    https://support.zendesk.com/hc/en-us/articles/1260803041889?page=2#comment_4404887963418

    BR, P.

    0
  • Chris Hronek

    In the "Testing a webhook" section is step 4 implying that we should be able to add request headers to the webhook? I don't see the option for creating headers in the webhook when I create it. Is this going to be an option?

    1
  • Nathan Purcell

    Is there a reference for the expected payload structure?

    0
  • Peter Hochstrasser

    Hi@...

    As the webhooks will replace targets (at this time, only http targets), the payload is not defined in the webhook definition, but in the webhook execution in a trigger or automation.
    In there, you can define the payload (as json).

    0
  • Nathan Gutauckas

    I was able to get my previous Trigger working by using the Update Many endpoint like@...mentioned.

    For me, my end result looks like this:

    创造了新的Webhook名叫更新许多门票Endpoint "https://[domain].zendesk.com/api/v2/tickets/update_many", PUT (not POST), and JSON.

    Trigger Action -> Notify active Webhook -> Update Many Tickets
    JSON body:

    {
    "tickets": [
    { "id": "{{ticket.id}}",
    "email_ccs": [
    { "user_email": "{{ticket.requester.custom_fields.cc_email}}", "user_name": "{{ticket.requester.custom_fields.cc_email}}", "action": "put"}
    ]
    }
    ]
    }

    After these changes everything seems to be working.

    1
  • Rahmat Budiharso

    Can I create custom request header for webhook?

    2
  • Beau P.
    Zendesk Customer Care

    Hello Rahmat,

    Currently it is not possible do so, but there is an active discussion here that our product management team is monitoring. I'd recommend following and adding your use-case to this discussion as this helps guide future platform improvements!https://support.zendesk.com/hc/en-us/community/posts/115009370628-Passing-API-Header-in-HTTP-Target

    Beau | Customer Advocate

    Ask ourZendesk Community

    0
  • Charles Larry

    "Webhook requests are automatically retried up to three times if the endpoint returns certain HTTP response codes. Unlike targets, consecutive failed requests won't deactivate webhooks."

    What are the "certain HTTP response codes"? Is this documented somewhere?

    0
  • Chris Sos
    Zendesk Product Manager

    Hi@...,

    Yes, this is documented onCreating and monitoring webhookson our developer documentation.

    Chris

    0
  • Bruno Cabral

    I am also interested in the custom request header feature

    0
  • Dave Dyson

    Hi Bruno,

    Head over toPassing API Header in HTTP Target, upvote that, and add your use case into the comments thread. The more information about what you'd need this for, the better. Thanks!

    0
  • Carmelo Rigatuso

    HI,

    We're using a web hook to create a ticket in an internal system for certain types of support requests. In the activity log, I can see that there is a response from the internal system which contains an ID that I would love to be able to add to the Zendesk ticket. Is there any way to read each response and add it to a form field in a ticket?

    1
  • Kevin Ford
    Community Moderator

    HiCarmelo Rigatuso,

    Unless Zendesk adds some new functionality, the only way you're going to be able to populate a ticket field is to have your internal system use the Zendesk API to update the field outside of sending the response.

    KF

    0
  • Takkme

    Hi,

    I want to send ticket information to my notion database. So I'm try to make webhook but i can't make it because of the error saying

    "{"object":"error","status":400,"code":"missing_version","message":"Notion-Version header failed validation: Notion-Version header should be defined, instead was `undefined`."}"

    How can I add Notion-Version to the header of zendesk webhook??

    0
  • Christopher Kennedy
    Zendesk Developer Advocacy
    Hi Takkme,

    At this time, it's not possible to supply custom headers when creating webhooks. Our Product Management team is considering additional authentication methods as a possible future feature enhancement. Feel free to share the details of your use case in aproduct feedback post. It can help us, as well as other users, gain insight into the problem you're looking to solve.

    Best,
    0
  • Dustin Swayne

    Can you create a side conversation via a webhook?

    Have tried the following with no success:

    https://mydomain.zendesk.com/api/v2/tickets/{ticket_id}/side_conversations

    and this in the trigger:

    {
    "message": {
    "body": "I was trying to print an email when the printer suddenly started burning",
    "from": {
    "email": "myemail@something.com",
    "name": "Johnny Agent"
    },
    "html_body": "I was trying to print an email when the printer suddenly started \u003cstrong\u003eburning\u003c/strong\u003e",
    "preview_text": "I was trying to print an email when the printer suddenly",
    "subject": "Help, my printer is on fire!",
    "to": [
    {
    "email": "bob@example.com",
    "name": "bob"
    }
    ]
    }
    }

    0
  • Dustin Swayne

    I figured it out I was using the wrong placeholder in the endpoint url. It should be {{ticket.id}}

    1
  • Gaurav Sharma

    Hi ,

    i am able to add private comments on tickets using target url and triggers , but when i try to use the similar login for webhook , only the tags are getting added from trigger but comment is not getting added , so could anyone please help :

    trigger :

    0
  • Dane
    Zendesk Engineering
    Hi Gaurav,

    Try to modify your webhook URL similar to the one below. And use JSON for the comment body.




    https://yoursubdomain.com/api/v2/tickets/{{ticket.id}}.json { "ticket": { "comment": { "body": "Followup 1 Completed", "public": false } } }
    1
  • Peter Hochstrasser

    Hi all

    Do webhooks support basic auth with tokens, i.e. adding /token to the name and specify a token generated in Admin Center, Apps and Integrations, APIs, Zendesk API, Settings, instead of a password?

    1
  • Timothy Schauder

    Peter Hochstrasser, yes it appears that you can use the /token authentication by setting basic authentication and using the format below.

    User:email@site.com/token
    Password: [Token]

    This actually addressed an issue I was having, so thanks for asking.

    2

Pleasesign into leave a comment.

Powered by Zendesk