Dynamic Node
function(user) {
//your logic goes here
return {
nodes:[]
};
}Add and send data
{
"node_type": "TEXT",
"txt": "<desired text>",
}{
"node_type": "IMAGE",
"txt": <null or String>,
"img": "<url of image",
}{
"node_type": "LINKS",
"txt": "<text message before links>",
"links": [//array of links as per the requirement. At least one obect is required in the array
{
"link_type": "EMAIL",//To show email link
"open_in_new_tab": true,
"title": "<text of button such as Email us>",
"email": "<email>"
},
{
"link_type": "PHONE",//To show click to call button
"open_in_new_tab": true,
"title": "<text of button such as Call us>",
"phone": "<phone number with ISD code"
},
{
"link_type": "WHATSAPP",//To show click to whatsapp
"open_in_new_tab": true,
"title": "<text of button such as Whatsapp us>",
"phone": "<phone number with ISD code"
},
{
"link_type": "LINK",//To show another link
"open_in_new_tab": true,//where you would like to open link on new tab on click
"title": "<text of button such as click here",
"url": "<full URL starting with https:// or http://"
},
{
"link_type": "PLAYBOOK",//To show another link
"open_in_new_tab": false,
"title": "<text of button such as click here",
"playbook": "5d78c366380d7b0c67bb6230"//playbook id
}
]
}Collect User Data
{
"node_type": "QUICK_REPLY",
"actions_on_response": [],
"text": "<text before quick reply>",
"responses": [//array of responses
{
"txt": "<option 1>"
},
{
"txt": "<option 2>"
},
{
"txt": "<option 3>"
}
],
"option_display_mode": "",// one of "HORIZONTAL" "VERTICAL" "DROPDOWN"
"placeholder": "<placeholder in case of dropdown such as Type to search..>"
}{
"node_type": "QUESTION_FORM",
"questions": [
{
"text": "<label for the field>",
"failMsg": "<Error msg when validation fails>",
"input_type": "NAME",//used when asking for name
"actions": [//array of actions to run after getting response
{
"type": "SET_NAME"//this action sets name to user's profile
}
],
"skip": false//whether user can skip this field
},
{
"text": "<label for the field>",
"failMsg": "<Error msg when validation fails>",
"input_type": "REGEX",//used to take single line input with regex based validation
"actions": [//array of actions to run after getting response
],
"skip": false,//whether user can skip this field
"regex_pattern": "^[a-zA-Z ]*$"//regex to validat the input
},
{
"text": "<label for the field>",
"failMsg": "<Error msg when email validation fails>",
"input_type": "EMAIL",//used to take email as input
"actions": [//array of actions to run after getting response
{
"type": "SET_EMAIL"//action to set email to user's profile
}
]
},
{
"text": "<label for the field>",
"failMsg": "<Error msg when email validation fails>",
"input_type": "PHONE",//used to take phone as input
"actions": [//array of actions to run after getting response
{
"type": "SET_PHONE"//action to set phone to user's profile
}
]
},
{
"text": "<label for the field>",
"failMsg": "<Error msg when email validation fails>",
"input_type": "TEXT",//used to take input using multi-line text area
"actions": []//array of actions to run after getting response
}
],
"txt_b4_questions": "<message before the form or null>",
"txt_after_questions": "<message after the form or null>",
}Last updated
Was this helpful?