Bulk trigger launch
Description
Launches a trigger campaign for multiple profiles.
This request is a batch version of the Trigger Launch (API call) request.
note
The request body size is limited by default to 10 Mb, exception for files — 100 Mb.
URL request
Method: POST
http://example.com/api/v1.1/campaigns/triggers/start_batch
Request parameters
Parameter | Type | Example | Required | Description |
---|---|---|---|---|
token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
format | string | "json" | No | Response data format. By default – json |
trigger_id | int | 1 | Yes | Trigger campaign ID |
attach | JSON array of File object | [] | No | File object |
content | JSON object |
| No | Data you can use in a message template using {apicontent.fieldname} variable |
custom_data | JSON object |
| No | Add some data to be used in Action hooks. The parameter can be passed either at the root of the request or separately in each data object. |
data | array |
| Yes | A field in the database and its value, which will be used to search for the desired profile. |
Profile matching mode | ||||
matching | string | "email" | No, if matched by email from profile or subscriptions | Profile matching mode By default - email Learn more. |
Response parameters
Parameter | Type | Description |
---|---|---|
error | int | Error code |
error_text | string | Error text |
result | array | Profile IDs to which the campaign was sent |
Request example (matching by email)
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 8,
"format": "json",
"matching": "email",
"data": [
{"email": "profile1@example.com"},
{"email": "profile2@example.com"}
]
}
Request example (matching by custom field)
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 455,
"format": "json",
"skip_triggers": false,
"matching": "custom",
"field_name": "New_field_1",
"data": [
{
"field_value": "001"
},
{
"field_value": "002"
}
]
}
Response example
{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"error": 409,
"error_text": "Unclear Matching"
},
{
"profile_id": "6042600a363b2746cd972a83"
}
]
}
Response example when a request constraint is triggered
{
"error":400,
"error_debug":"http: request body too large",
"error_text":"Invalid request"
}