sendMessage #
Sends an SMS to each recipient using one of the registered Twilio accounts.
The Twilio provider accepts the phoneNumber recipient type: each entry of recipients is an object with a to phone number in E.164 format.
Query Syntax #
HTTP #
URL: http://kuzzle:7512/_/hermes/providers/twilio/accounts/:accountId
Method: POSTOther protocols #
{
"controller": "hermes",
"action": "sendMessage",
"providerId": "twilio",
"accountId": "<account id>",
"body": {
"recipients": ["<recipient phone number>"],
"content": {
"body": "<sms content>"
},
"params": {
"from": "<twilio phone number>" // optional — overrides account default_sender
}
}
}Kourou #
kourou hermes:sendMessage -a providerId=twilio -a accountId=<account id> --body '{
"recipients": ["<recipient phone number>"],
"content": {
"body": "<sms content>"
},
"params": {}
}'Arguments #
providerId: provider identifier,twilioaccountId: identifier of a registered Twilio account
Body properties #
recipients: array of E.164 phone number strings (recipient typephoneNumber)content.body: SMS textparams.from: sender override (optional)
params is validated against the provider's messageAdditionalParamsSchema.
Response #
Returns an empty result on success.
{
"requestId": "d16d5e8c-464a-4589-938f-fd84f46080b9",
"status": 200,
"error": null,
"controller": "hermes",
"action": "sendMessage",
"result": null
}