Messages
Send a text message
POST /meta/send-message
Send a text message to a user through your Polser account
Headers
Content-Type
application/json
Authorization
your-api-key
Body
source_phone is an optional parameter for those customers who have multiple phone numbers in their Polser account.
{
"phone_number": "+34XXXXXXXXX",
"message": "hey there!",
"source_phone": "+44XXXXXXXXX" // Optional
}Response
{
"message": "Message sent"
}The message was sent successfully.
{
"error": "Customer last message date is more than 24 hours"
}The message was not sent because the 24-hour window with this phone number has closed, send a template instead.
{
"error": "Use a template to send a message to this number"
}The message was not sent because you have not contacted this number yet, and Meta doesn't allow you to send text messages to new customers, send a template instead.
{
"error": "Source phone is required for multinumber accounts"
}The message was not sent because you have not provided a source_phone in the request but your account has multiple phone numbers activated.
{
"error": "Unauthorized"
}The API key is missing or incorrect.
Send a template message
POST /meta/send-message
Send a template message to a user through your Polser account
Headers
Content-Type
application/json
Authorization
your-api-key
Body
This method only accepts variables that exist in the BODY of the Meta template. source_phone is an optional parameter for those customers who have multiple phone numbers in their Polser account.
{
"phone_number": "+34XXXXXXXXX",
"template_name": "appointment_confirmation",
"variables": [
"John",
"10:00 PM"
],
"source_phone": "+44XXXXXXXXX" // Optional
}Response
{
"message": "Template sent successfully"
}The message was sent successfully.
{
"error": "Template not found, not approved or invalid variables"
}Check that the template name is correct and that it's approved in Meta. Also check that the number of variables that the template requires matches the number of variables you provided.
{
"error": "Unauthorized"
}The API key is missing or incorrect.
Last updated
Was this helpful?