SendingPayload Model
Example #1
Creates Sending without schedule to audience defined by given conditions
{
// Schedule is not provided, so message will not be scheduled
"audience": {
"type": "inline",
"conditions": [
{
"condition_group": "member_properties", "field": "first_name",
"operator": "match", "value": "Piotr"
}
]
}
}
Example #2
Schedules message sending 2 days from now to members of audience defined by ID and 2 arbitrary recipients
{
"schedule": { "type": "relative", "in": "2 days" },
"audience": { "type": "inline", "id": 15 },
"recipients": [
{ "member_id": 150, "properties": { "name": "Piotr" } },
{ "email": "jan@example.com", "properties": { "name": "Jan" } }
]
}
Definition
Key | Type | Description |
---|---|---|
draft | bool | If true (false, by default), the Sending is not scheduled for execution, even if schedule is present |
priority | Integer (1-10) | Requires Messages:Api:Sendings:SetPriority permit |
channels_preference | string[] | See: Channels preference |
schedule | SendingSchedulePayload | |
audience | SendingAudiencePayload | |
recipients | Recipient | |
properties | Object | Sending-wide merge-tags |
audience
- members of the audience will be used as recipientsrecipients
- inline receiversschedule
is optional - when not provided, sending will not be scheduled (will have draft
status).Channels preference
for delivering the Message to the recipient and specify the preferred order (priority).
Specific Validation Errors
Attribute | Error key |
---|---|
(base) | sending_must_have_audience_or_recipients |
SendingSchedulePayload model
Example #1 - immediate schedule
{
"type": "immediate"
}
Example #2 - absolute schedule
{
"type": "absolute",
"at": "2020-10-18T10:59:32.340Z"
}
Example #3 - relative schedule
{
"type": "relative",
"in": "5 minutes"
}
Definition
Key | Type | Description |
---|---|---|
type | enum: ['immediate', 'absolute', 'relative'] | |
at | ISO 8601 DateTime | For absolute type - defines exact time the sending should be executed at |
in | string | For relative type - see below |
prescheduled | boolean | For relative and absolute types - see below |
in
formatnumber
of time unit
s the sending will be scheduled at in format described by followingregex:
^(?<number>\d+) (?<unit>second|minute|hour|day|week|month|year)s?$
.30 minutes
1 day
5 months
Therefore, by providing
prescheduled: true
schedule param, the preparation will start 5 minutes before the actual transmissionto speed up the sending execution.
SendingAudiencePayload model
Example #1 - audience by reference
{
"type": "inline",
"id": 532
}
Example #2 - audience by inline conditions
{
"type": "inline",
"conditions": [
{
"condition_group": "member_properties", "field": "first_name",
"operator": "match", "value": "Piotr"
}
]
}
Key | Type | Description |
---|---|---|
type | enum: ['reference', 'inline'] | |
id | integer | For reference type - ID of audience the sending should be sent to |
conditions | Object[] | For inline type - See DMP docs |
Specific Validation Errors
Attribute | Error key |
---|---|
id | referenced_audience_must_exist |
Modified at 2024-04-22 22:18:17