API/Triggers - Unable to edit description

4 コメント

  • Donatas Gostautas
    コメントアクション Permalink

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

    0
  • Niall Colfer
    コメントアクション Permalink

    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.

    0
  • Profi Tours
    コメントアクション Permalink

    Hello,

    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:

    https://developer.zendesk.com/rest_api/docs/chat/triggers

    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. 

     

    0
  • Profi Tours
    コメントアクション Permalink

    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" : [
    "and",
    [
    "icontains",
    "@visitor_page_url",
    "stripshoe"
    ],
    [
    "stillOnPage",
    20
    ]
    ],
    "actions" : [
    [
    "sendMessageToVisitor",
    "Timmy",
    "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"
    0

ログインしてコメントを残してください。

Powered by Zendesk