API/Triggers - Unable to edit description

4 Kommentare

  • Donatas Gostautas

    One more thing - creating an enabled but empty trigger makes all other triggers inactive.

  • Niall Colfer
    Zendesk team member

    Hi Donatas,

    Thanks for reaching out. I was able to successfully create a trigger with description using cURL, and it did not deactivate my other triggers. I'm going to create a ticket with you so that we can discuss the particular implementation of your Python script, speak to you shortly via email.

  • Profi Tours


    We have a similar problem when we try to manage triggers via the API.

    When we add or update triggers with "name", "enabled" and "description" attributes only, everything works fine. However, in this case the created triggers actually do nothing. 

    When we add "definition" > "event", "condition" and "actions" attributes , so that the trigger can respond to some condition and perform some actions
    - if creating a trigger "definition" is obviously omitted at all.
    - if updating a trigger the error below is returned

    Sample update (PUT) request:

    {"enabled":true,"name":"hotel_494_2038","description":"Bellevue hotel 15% hotel_lm","definition":{"event":"page_enter","condition":["and",["icontains","@visitor_page_url","http:\/\/www.somedomain.com\/"],["stillOnPage","20"],["eq","@visitor_requesting_chat",false],["eq","@visitor_served",false],["eq","@visitor_triggered",false],["not",["firedBefore"]]],"actions":[["sendMessageToVisitor","Profi Tours","Test message"],["setTriggered",true],["addTag","emberli"]]}}

    Sample response:

    {"description": "definition.actions is not a mutable field", "error": "SchemaError"}

    The definition attribute is actually not mentioned in the docs:


    But as it is the essence of the trigger i cannot imaging it is not editable via the API, I presume we are doing something wrong. 


  • Profi Tours

    I have seen here https://chat.zendesk.com/hc/en-us/articles/223853088-Triggers-reference-for-developers-

    that "Definitions are not editable in Update Trigger." so that might be expected.

    However I cannot make Create Trigger take into consideration the definition attribute.


    Even when I run from command line the example given at https://chat.zendesk.com/hc/en-us/articles/223853088-Triggers-reference-for-developers- the trigger is created successfully, but the definition attribute is discarded in the created trigger.

    curl https://www.zopim.com/api/v2/triggers \
    -d '{
    "name" : "Stripe Shoe",
    "enabled" : 1,
    "description" : "Send discount code for Stripe Shoe",
    "definition" : {
    "event" : "page_enter",
    "condition" : [
    "actions" : [
    "We have a discount code for you! Use DISCOUNT10 on your next checkout"
    }' \
    -v -u {email_address}:{password} \
    -X POST -H "Content-Type: application/json"

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk