Transactional — Automation¶
An automation moves contacts of the transactional object's contact list through a flow of nodes: a trigger, then waits, conditions and actions (send a message, set a field, call your service). See the Automations guide for a walkthrough.
Endpoints¶
| Method | URL |
|---|---|
GET |
/transactional/<transactional>/automation/<automation> |
POST |
/transactional/<transactional>/automation |
PUT |
/transactional/<transactional>/automation/<automation> |
DELETE |
/transactional/<transactional>/automation/<automation> |
The automations of a transactional object are listed by
GET /transactional/<transactional> (automations). Send the parameters
form-encoded or in the query string.
GET /transactional/<transactional>/automation/<automation>¶
Payload: No payload.
Returns: The automation, its transactional object, all its nodes indexed by node ID
(transactionalAutomationNodes) and the IDs of the entry nodes
(transactionalAutomationNodeRootIds). Requires write access to the transactional object.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
https://app.duo.pt/transactional/{transactional_id}/automation/{automation_id}
Response:
{
"success": true,
"data": {
"transactionalAutomation": {
"id": 7,
"name": "Payment follow-up",
"enabled": true,
"send_transactional": 1
},
"transactional": {
"id": 1,
"owner": 1,
"name": "Order Confirmation",
"list": 1,
"domain": 1,
"smtp_submission": false,
"send_dsn": false
},
"transactionalAutomationNodes": {
"31": {
"id": 31,
"send_transactional_automation": 7,
"type": "externalEventEntry",
"title": "Contact event occurs",
"comment": "Event payment happened to contact",
"child": 32,
"child2": null,
"payload": { "event": "payment", "fields_to_set": [] }
},
"32": {
"id": 32,
"send_transactional_automation": 7,
"type": "sendMessage",
"title": "Receives a message",
"comment": "Receives message Order paid",
"child": null,
"child2": null,
"payload": { "message": 12 }
}
},
"transactionalAutomationNodeRootIds": [31]
}
}
POST /transactional/<transactional>/automation¶
| Parameter | Type | Description |
|---|---|---|
name |
string | Required. Automation name |
enabled |
boolean | Optional. true or false. Defaults to false: a new automation is disabled. |
Returns: The new automation (transactionalAutomation) and its transactional object.
Example:
curl -u "username:api_key" -H "Accept: application/json" \
-d "name=Payment+follow-up" \
https://app.duo.pt/transactional/{transactional_id}/automation
Response:
{
"success": true,
"data": {
"transactional": {
"id": 1,
"owner": 1,
"name": "Order Confirmation",
"list": 1,
"domain": 1,
"smtp_submission": false,
"send_dsn": false
},
"transactionalAutomation": {
"id": 7,
"name": "Payment follow-up",
"enabled": false,
"send_transactional": 1
}
}
}
PUT /transactional/<transactional>/automation/<automation>¶
| Parameter | Type | Description |
|---|---|---|
id |
int | Required. The automation ID, the same as in the URL |
name |
string | Optional. New name |
enabled |
boolean | Optional. true starts processing contacts; false stops it |
Only the fields you send are changed.
Returns: The edited automation and its transactional object.
Example — enable an automation:
curl -u "username:api_key" -H "Accept: application/json" \
-d "x-verb=PUT&id={automation_id}&enabled=true" \
https://app.duo.pt/transactional/{transactional_id}/automation/{automation_id}
Response:
{
"success": true,
"data": {
"transactional": {
"id": 1,
"owner": 1,
"name": "Order Confirmation",
"list": 1,
"domain": 1,
"smtp_submission": false,
"send_dsn": false
},
"transactionalAutomation": {
"id": 7,
"name": "Payment follow-up",
"enabled": true,
"send_transactional": 1
}
}
}
DELETE /transactional/<transactional>/automation/<automation>¶
Payload: No payload.
Returns: The deleted automation and its transactional object. Its nodes are deleted too.
Example: