In the example below you can see how a Zenvia SMS channel can be built using a webhook template. This can be used to send SMS messages via Zenvia. The url comes from the Zenvia API docs :
URL: https://api-rest.zenvia360.com.br/services/send-sms
The API call is being made to this Messages endpoint used to send SMS messages and you will need to use raw text to send params. Params include:
- sendSmsRequest: Name of the JSON Object containing other params
- msg: The text of the message to be sent
- from: The from header used in the SMS message usually your brand name e.g. "xtremepush"
- to: the mobile number of the user this is being pulled in from your users profile via the personalisation syntax {{mobile_number}}
NOTE: Params placed in raw text as JSON like below:
{ "sendSmsRequest": { "from": "xtremepush", "to": "{{ mobile_number | json_encode }}", "msg": "Message Text Here" } }
Finally this API requires a number of headers:
- Authorization: used to authenticate the API call the example uses a base64 encoded credential starred out below. This is credential is created by base64 encoding your credentials as described in the Zenvia API docs
- Content-Type:for this example the type is “application/json”
- Accept: for this example the type is “application/json”
Template
Once you have your webhook working we recommend you save it as a template. This will allow you to quickly select it on the webhook channel page in campaign creation:
So you can save your Zenvia template with all settings configured except for the message text string. When you want to send SMS via Zenvia use you webhook template and fill out the message text.
Comments
0 comments
Article is closed for comments.