Saltar al contenido principal

BroadcastDraft

namestring

Possible values: non-empty and <= 120 characters

phoneNumberIdstringnullable
templateNamestringnullable

Possible values: <= 512 characters

templateLanguagestringnullable

Possible values: >= 2 characters and <= 15 characters

Example: pt_BR
variables objectnullable

De dónde viene cada variable de la plantilla: header y body por el marcador ("1", "2"… o el nombre), buttons por el índice del botón. Toda fuente de contacto o campo exige un fallback para quien no tiene el dato. Un encabezado de medio necesita headerMedia.

header object
property name* VariableSource

contact (un dato del contacto), attribute (un campo personalizado) o static (un valor fijo).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

body object
property name* VariableSource

contact (un dato del contacto), attribute (un campo personalizado) o static (un valor fijo).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

buttons object
property name* VariableSource

contact (un dato del contacto), attribute (un campo personalizado) o static (un valor fijo).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

headerMedia object
typestring

Possible values: [image, video, document]

linkstring<uri>

Possible values: <= 2000 characters

idstring

Possible values: <= 100 characters

filenamestring

Possible values: <= 240 characters

audienceIdstringnullable

Público guardado. Con audienceId y audienceFilter, vale el audienceId.

audienceFilter objectnullable

Árbol de condiciones de un público: grupos and/or con hasta 3 niveles y 30 condiciones en total. Los operadores válidos para cada tipo de campo vienen de GET /audiences/schema.

opstringrequired

Possible values: [and, or]

rulesobject[]required

Possible values: <= 30

scheduledAtstring<date-time>nullable
timezonestring
Example: America/Sao_Paulo
sendWindow objectnullable

Días de la semana (0 = domingo) y horario en que la campaña puede enviar, en la zona timezone. Fuera de él, se pausa y se reanuda sola.

daysinteger[]

Possible values: >= 1, <= 7

startstring

Possible values: Value must match regular expression ^\d{2}:\d{2}$

Example: 09:00
endstring

Possible values: Value must match regular expression ^\d{2}:\d{2}$

Example: 20:00
throttlePerMinuteintegernullable

Envíos por minuto. Sin valor, el predeterminado de la plataforma.

Possible values: >= 10 and <= 60000

flowIdstringnullable

Flujo que responde a los botones de respuesta rápida de la plantilla.

BroadcastDraft
{
"name": "string",
"phoneNumberId": "string",
"templateName": "string",
"templateLanguage": "pt_BR",
"variables": {
"body": {
"1": {
"source": "contact",
"key": "first_name",
"fallback": "cliente"
},
"2": {
"source": "static",
"value": "BLACK20"
}
}
},
"audienceId": "string",
"audienceFilter": {
"op": "and",
"rules": [
{
"type": "consent",
"op": "is",
"value": "opted_in"
},
{
"type": "field",
"key": "cidade",
"op": "eq",
"value": "Curitiba"
}
]
},
"scheduledAt": "2024-07-29T15:51:28.071Z",
"timezone": "America/Sao_Paulo",
"sendWindow": {
"days": [
0
],
"start": "09:00",
"end": "20:00"
},
"throttlePerMinute": 0,
"flowId": "string"
}