NodeAction
Single action to perform when the candidate enters a Node. This has many different variations like say-text
, say-contact
, ask-text
, say-location
, say-list
, etc..
Endpoints
GET /node-actions
- Retrieve all node actions (of all flows and nodes)GET /node-actions/{id}
- Retrieve a single node action by IDPOST /node-actions
- Create a new node actionPATCH /node-actions/{id}
- Update a node action by IDDELETE /node-actions/{id}
- Delete a node action by ID
Attributes
actionType
String
Type of action (can be either 'ask' or 'say')
value
Object
A json-object containing the data required to perform the action
variableName
String
Where to store the user answer in the session (only for type 'ask')
index
Integer
Position within the node, index 0 is the first action
subType
String
Type of the content to be delivered: 'text', 'contact', 'location', 'list', 'appointment', 'image', 'video', 'audio', 'document', 'set-variable'
HTTP methods
actionType
X
X
X
value
X
X
X
variableName
X
X
X
index
X
X
X
subType
X
X
X
Example bodies
Post
{
"data": {
"type": "nodeActions",
"attributes": {
"actionType": "ask",
"subType": "text",
"value": {
"text": "What is your name?"
},
"index": 0,
"variableName": "name",
},
"relationships": {
"node": {
"data": {
"type": "nodes",
"id": "owning-node-id",
}
}
}
}
}
Patch
{
"data": {
"id": "your-node-action-id",
"type": "nodeActions",
"attributes": {
"value": {
"text": "What is your name?"
},
}
}
}
OpenAPI
NodeActions found
GET /public/v2/node-actions/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Accept: */*
NodeActions found
{
"data": {
"id": "5bd83604-b871-460d-9d62-ba885364b8ab",
"type": "nodeActions",
"attributes": {
"createdAt": "2024-08-20T10:45:10+00:00",
"updatedAt": "2024-08-20T10:45:10+00:00",
"actionType": "say",
"variableName": null,
"index": 5,
"subType": "text",
"attachmentData": null,
"value": {
"text": "value"
}
},
"relationships": {
"node": {
"links": {
"related": "/public/v2/nodes/280b920d-d3f0-4f5b-8007-132279a3eaa1"
}
}
}
},
"meta": {}
}
NodeTransition updated
PATCH /public/v2/node-actions/{id} HTTP/1.1
Host: {defaulthost}
Authorization: YOUR_API_KEY
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 151
{
"data": {
"id": "text",
"type": "text",
"attributes": {
"actionType": "text",
"variableName": "text",
"index": 1,
"subType": "text",
"attachmentData": {},
"value": {}
}
}
}
NodeTransition updated
{
"data": {
"id": "fb43f2e6-d090-4084-903f-a0d7e680f7cc",
"type": "nodeActions",
"attributes": {
"createdAt": "2024-08-20T10:45:10+00:00",
"updatedAt": "2024-08-20T10:45:10+00:00",
"actionType": "say",
"variableName": null,
"index": 10,
"subType": "contact",
"attachmentData": null,
"value": {
"text": "hi this works",
"id": "e6ecc47d-e22a-47b9-98df-ec3ecd36e2d9",
"name": "David Blane",
"time_frame_message": "What day would be most convenient for you?",
"time_slot_message": "Which time on that day would suit your schedule best?",
"calendar_type": "user"
}
},
"relationships": {
"node": {
"links": {
"related": "/public/v2/nodes/f2075e50-8519-4ca9-8b84-4fb67c3d7bec"
}
}
}
},
"meta": {}
}
Last updated