웹훅을 만들어 타사 시스템과 상호작용하기



image avatar

Jacquelyn Brewer

Zendesk Documentation Team

2025년 3월 19일에 편집됨


4

0

댓글 81개

hello why my webhooks got 400 bad request and no username

 

 

 

got this error

 

"code": 400,
    "name": "Bad Request",

0


Efthymis Kouzelis

There is one for the tag and another for the value of such a field, you can reference this:
https://support.zendesk.com/hc/en-us/articles/4408886858138-Zendesk-Support-placeholders-reference

ticket.organization.custom_fields.<field_key> Property/placeholder format for custom organization fields. See Adding custom fields to organizations.
ticket.organization.custom_fields.<field_key>.title Property/placeholder format for the value of a custom organization drop-down field. See Adding custom fields to organizations

0


Thank you Otto for the help,

Still my main question is "what's the placeholder for an organization custom field"? Can you help?

Thanks

0


Hi Efthymis!

When you want to update custom fields on tickets via API, you need to have to have correct structure. Custom fields on the ticket JSON needs to be on an array like this:

{   
    "ticket": {    
        "comment": {            
            "body": "Body of the message",
            "public": true,
        },
        "custom_fields":[{
            "id": 123456789, //This is the field ID from Zendesk
            "value":"Content for the custom field."
            }]  
    }
}

1


Hello all!

I've managed to create the webhooks and triggers to update tickets. I am stuck though on trying to populate a ticket custom field from a ticket.organization_custom _field.
Is there anyone here who has done it?
example
Organization_custom_field (id:34) is automatically populated through internal code.
I want this info to be transferred to a ticket_custom_field (id:45). 
I need the JSON body to do this.

Thanks in advance

0


Hi Ricardo,

If you are certain that you have followed all the steps and have used the correct endpoints, try to follow the steps in debugging webhooks. You can also try to update the authentication on the webhook or deactivate and activate it again. If the same issue persisted, you can contact support directly for further investigation.

0


Has anyone tried creating a webhook for discord since Zendesk discord integration is no longer supported.

0


Hello.  As 2FA Session management has not been securely implemented (to mandate users must use 2FA with every login event) I would like to establish an automation to achieve:

At 7pm each night - destroy all active sessions.

Can you please provide guidance to this.
- I have established a webhook that calls the Sessions API and is authenticated via token.
- How to build the automation that is preferably time dependant.  I imagine the logic will need to be something like:  Loop through all open sessions - destroy each active session.

I am not a developer, and at this time I can't see how to achieve this in automation.  Please do provide some detailed guidance - especially given the 2FA implementation is not secure.

Thanks,

0


Hi Kelly Centeno -- I'm pretty sure your setup is correct and is already actually working.

A couple of things about your test setup from the screenshots of the Webhook creation page:

  • For the Request JSON body in your screenshot you have the default placeholder request body that Zendesk automatically puts there. If you tried to use that with this PUT request you'll definitely always receive the 404 response. In that box you should put the same JSON request payload as what you have in the second screenshot
  • Another important thing to note about the webhook test is that the test won't work correctly with placeholders like {{ticket.id}} -- but it looks like you've got the placeholders correct in the endpoint of the webhook and request body from the trigger

In order to test a webhook like this I would submit a test ticket and then use that specific ticket ID rather than the {{ticket.id}} placeholder in the endpoint.

And I would take the request body you have in the second screenshot, from the trigger, and paste that into the test box but again you'll have to replace the custom field placeholder values for the actual values that are stored in the associated custom fields.

As far as I can tell, the only problem that you could have with the setup is if the custom field values with the intended collaborators don't conform to the requirements of the additional_collaborators property. I'm pretty sure you can simply pass just an email address there but it can also take IDs and objects consisting of a name and email property. I'm assuming you're storing an email address in those custom organization and ticket fields so that should be all good!

0


We've been back and forth with Zendesk support for the past month and have not got anywhere so I'm hoping if anyone reads this and can help out will comment. Our tickets used to automatically CC the CSMs of the Salesforce account. For some reason this stopped working and we were told to create webhooks. We have and it still fails the test but when I check Activity it says success. Does anyone know what we can do to have the Salesforce CSMs email CC on every ticket?

This is our current webhook and trigger set up. Any help is greatly appreciated. 

0


댓글을 남기려면 로그인하세요.