Skip to content

Action

Action Schema

There are actions for the bot to take when a user interact with a controller associated with the action

These are common properties for all type of actions

Field Required Type Description Restriction
label false* String Label for the action

  • is required for Message of type Button Template and Carousel Template and quick reply object.
  • Maximum character is 20
area false* Object area of the action (see Area Object below) is required for Message of type imagemap
Field Required Type Description Restriction
x true Integer Horizontal position relative to the left edge of the area Value must be 0 or higher.
y true Integer Vertical position relative to the top of the area Value must be 0 or higher.
width true Integer Width of the tappable area
height true Integer Height of the tappable area

There are 5 types of actions.

When a message action is prompted, a string in field text will be sent as a message from the user

Field Required Type Description Restriction
type true String Required as message
text true String Text sent when the action is performed
//In Message of type Button Template and Carousel Template and quick reply object
{
"type":"message",
"text":"This is a user's message",
"label":"users message"
}

When a postback action is prompted, a postback event is returned via webhook

Field Required Type Description Restriction
type true String Required as postback
data true String String returned via webhook
text false String Text displayed in the chat as a message sent by the user when the action is performed
//In Message of type Button Template and Carousel Template and quick reply object
{
"type":"postback",
"data":"action=buy&itemid=111",
"text":"Buy",
"label":"Buy"
}

When a control associated with this action is tapped, a workflow template will be prompted to the user

Field Required Type Description Restriction
type true String Required as workflowTemplate
templateId true Stringe workflow template ID
//In Message of type Button Template and Carousel Template and quick reply object
{
"type":"workflowTemplate",
"templateId":"5d7385a4edde5726453d49dc",
"label":"Leave workflow template"
}

When a control associated with this action is tapped, the workflow will be prompted to the user

Field Required Type Description Restriction
type true String Required as workflow
workflowId true String The user’s workflow ID
// In Message of type Button Template and Carousel Template and quick reply object
{
"type":"workflow",
"workflowId":"5d73870fedde5726453d49e0",
"label":"Your pending workflow"
}

When a control associated with this action is tapped, the user will be redirect to the Workflows page.

Field Required Type Description Restriction
type true String Required as workflows
status false String The workflow status, used to filter the Workflows ‘awaiting’, ‘processing’, ‘completed’, ‘rejected’, ‘canceled’
// In Message of type Button Template and Carousel Template and quick reply object
{
"type":"workflows",
"status":"awaiting",
"label":"Your awaiting workflows"
}

When a control associated with this action is tapped, the user will be redirect to the corresponding Library document.

// In Message of type Button Template and Carousel Template and quick reply object
{
"type": "library",
"label": "2020 Public Holidays",
"url": "https://h1.eko12.local?redirect_path=doc%2F5e620b89cd88e30014a13e9c&eko_action=open_library"
}

When a control associated with this action is tapped, the URI specified in the linkUri property is opened.

Field Required Type Description Restriction
type true String Required as uri
linkUri true Stringe URI opened when the action is performed
//In Message of type Button Template and Carousel Template and quick reply object
{
"type":"uri",
"linkUri":"https://ekogreen.ekoapp.com",
"label":"Buy"
}