SmsFireTrigger¶
POST sms/trigger/fire
Fires an event by hand, exactly as the platform would. Use it to test a trigger and its templates without waiting for the real event.
The answer says how many messages the event actually produced and which triggers are
subscribed to it — a queued: 0 with a non-empty knownTriggers means the templates or
the payload are at fault, not the subscription.
Access Control¶
Allowed role: admin. The event is processed under the brand of the caller.
Request¶
POST https://{broker_domain}/sms/trigger/fire
{
"event": "crm.customer.deposit",
"data": {
"client": {
"msisdn": "+380951234567"
},
"payment": {
"sum": "250 EUR"
},
"sendToParentType": "CUSTOMER",
"sendToParentId": 140
}
}
{
"command": "SmsFireTrigger",
"extID": "1",
"data": {
"event": "crm.customer.deposit",
"data": {
"client": {
"msisdn": "+380951234567"
},
"payment": {
"sum": "250 EUR"
},
"sendToParentType": "CUSTOMER",
"sendToParentId": 140
}
}
}
const res = await platform.SmsFireTrigger({
event: "crm.customer.deposit",
data: {
client: {
msisdn: "+380951234567"
},
payment: {
sum: "250 EUR"
},
sendToParentType: "CUSTOMER",
sendToParentId: 140
}
});
Request Data¶
| Field | Type | Required | Description |
|---|---|---|---|
event |
string | Yes | Event name to fire |
data |
object | Yes | Event payload, as the platform would send it |
Response Data¶
{
"event": "crm.customer.deposit",
"queued": 1,
"knownTriggers": [2]
}
Errors¶
| Code | Error | Description |
|---|---|---|
400 |
VALIDATION_ERROR |
Missing event name or payload |
403 |
PERMISSION_DENIED |
Not an admin session |