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 | Data used for integration Action hooks |
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)
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 8,
"format": "json",
"matching": "email",
"data": [
{
"email": "example1@example.com"
},
{
"email": "example2@example.com"
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<trigger_id>85</trigger_id>
<format>xml</format>
<matching>email</matching>
<data>
<email>example1@example.com</email>
</data>
<data>
<email>example2@example.com</email>
</data>
</xml>
Request example (matching by custom field)
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"trigger_id": 96,
"format": "json",
"skip_triggers": false,
"matching": "custom",
"field_name": "Custom_ID",
"data": [
{
"field_value": "003"
},
{
"field_value": "002"
}
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<trigger_id>85</trigger_id>
<format>xml</format>
<skip_triggers>false</skip_triggers>
<matching>custom</matching>
<field_name>Custom_ID</field_name>
<data>
<field_value>YY</field_value>
</data>
<data>
<field_value>AA</field_value>
</data>
</xml>
Response example
- JSON
- XML
{
"error": 0,
"error_text": "Successful operation",
"result": [
{
"profile_id": "6606e08f10bcdd88297057a7"
},
{
"profile_id": "66101437dc4594c2934da6da"
}
]
}
<xml>
<error>0</error>
<error_text>Successful operation</error_text>
<result>
<profile_id>66101437dc4594c2934da6da</profile_id>
</result>
<result>
<profile_id>6606e08f10bcdd88297057a7</profile_id>
</result>
</xml>
Response example when a request constraint is triggered
- JSON
- XML
{
"error":400,
"error_debug":"http: request body too large",
"error_text":"Invalid request"
}
<xml>
<error>400</error>
<error_debug>http: request body too large</error_debug>
<error_text>"Invalid request"</error_text>
</xml>