Sending SMS via HubSpot
SMS integration API for use with the HubSpot platform.
Note
To use the API, utilize the WebHook functionality:

Webhook URL https://sms.witi.me/sms/hubspot_send_sms.aspx?api_key=API_KEY&template=TEMPLATE_ID
Method POST
Input JSON with contact data (sent by the WebHook registered in HubSpot)
Response JSON with the result of the sending scheduling
| Parameter | Description |
|---|---|
| api_key | The API key can be found in the SMS > SMS Settings menu. |
| template | ID of the template registered on the Witime platform (SMS > SMS Templates menu). |
| rota | [Optional] If not provided, the default route is used |
| numero | [Optional] If not provided, uses the mobilephone parameter sent by HubSpot |
Example Output:
{
"Resultado": {
"CodigoResultado": 0,
"Mensagem": "Message processed successfully. Processed in 177ms.",
"Chave": "154d1c4d-2836-4913-10f8-084b20f3e9ze",
"Cobrado": true,
"ValorCobrado": 0.20
},
"Mensagens": [
{
"numero": "+5511987654321",
"mensagem": "test message 1",
"UniqueID": "31b2c48f-2ea9-4979-a9dd-cbfb927de18f",
"DataAgendamento": "2020-07-26 14:35:08",
"Custo": 0.2000,
"idDisparo": 25,
"Situacao": 1,
"MensagemSituacao": null,
"Codigo_cliente": "0000001",
"Rota": 228
}
],
"Saldo": 3220.6300
}
Templates
To register SMS templates, go to the SMS > SMS Templates menu. Use the Web ID field in HubSpot calls.

Variables
You can use variables provided by HubSpot in your messages, such as: $firstname$, $lastname$, $email$, $state$, among others. To access the complete list of variables, run a WebHook test in HubSpot itself to analyze the variables sent in the POST:
