Actions format

Actions format

Action add tag

Use this response to add a tag to a subscriber. Tag with the same name must exist in your bot:

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "add_tag",
        "tag_name": "your tag",
      }
    ],
    "quick_replies": []
  }
}

Tag name sent using tag_name parameter should match one of existing tags within OCP bot

Action remove tag

Use this response to remove a tag from a subscriber. Tag with the same name must exist in your bot:

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "remove_tag",
        "tag_name": "your tag",
      }
    ],
    "quick_replies": []
  }
}

Action set subscriber’s field value

Use this response to set subscriber’s field value. Custom field with the same name must exist in your bot

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "set_field_value",
        "field_name": "your field name",
        "value": "some value"
      }
    ],
    "quick_replies": []
  }
}

Filed name sent using field_name should match with name of one of custom fields existing within OCP bot You need to control data type recorded in custom fields, data type should match type of custom field

Use following value formats:

  • For Number field type value should be numeric like 2 or 3.14 not bounded by double quotation marks;

  • For Text field type value should be transferred as text "some text";

  • For Date field type value should be transferred as text with date formatted like YYYY-MM-DD, i.e. "2018-03-25";

  • For Date Time field type value should be transferred as text with date formatted in ISO8601 UTC, i.e "2018-03-25T13:25:00.000Z"


Action unset subscriber’s field value

Use this response to unset (clear) subscriber’s field value. Custom field with the same name must exist in your bot

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com"
          }
        ]
      }
    ],
    "actions": [
      {
        "action": "unset_field_value",
        "field_name": "your field name"
      }
    ],
    "quick_replies": []
  }
}

    • Related Articles

    • SSO Actions

      OCP now allows its users to further expand on its SSO login with SSO actions. You will now be able to link, delink channels, and other actions which you were not be able to do previously using automations in flow builder. Using SSO Actions Inside the ...
    • Messages format

      Sending text Use this response for sending text messages. url, node and call buttons can be used with text message. The "buttons", "actions", "quick_replies" properties are optional. { "version": "v1", "content": { "messages": [ { "type": "text", ...
    • Actions

      Action is the core of the app. It shows what your app can do. On the user side, they simply give you inputs and get their outputs. So, each mini-app action consists of 3 parts, Part Description Inputs (optional) To get data from chatbot Outputs ...
    • How to format date time?

      There are date time custom field in OCP, sometime, you want to format them properly. Here is a few formats you can refer. The following characters can be used: d - The day of the month (from 01 to 31) D - A textual representation of a day (three ...
    • Quick replies

      quick_replies property of server response is optional. Quick replies cannot be used in dynamic block of a content node if there are other blocks exist afterwards. Quick reply description format is the same for buttons, it supports content, node, ...