Send Message Endpoint

List of HTTP methods available

  • POST sendmessage
  • PUT sendmessage

POST sendmessage

Template Notification - HSM

Description

Send a predefined template in a WhatsApp number assigned to your account, Remember an HSM is a trigger that will encourage the user to start with a conversation, once the conversation starts, is not necessary to keep sending templates, you can continue the conversation with the Customer Support methods.

This are the templates you will have available:

  • Text Template
  • Text Template + Quick Reply Buttons
  • Text Template + Call to Action Buttons
  • Multimedia
  • Multimedia + Quick Reply Buttons
  • Multimedia + Call to Action Buttons

Resource URL

https://api.quiubas.com/wab/sendmessage

Send Template (HSM) Message with ID

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
messageYesYour text content
agentYesYour WAB Agent
idYesID of an approved template.

Send Template (HSM) Message with Variable Content

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
messageYesYour text content
agentYesYour WAB Agent
idYesID of an approved template.

PUT sendmessage

Customer Support Reply

Description

Send messages to a conversation once the user has replied to a template (HSM) or a conversation initiated by the user.

Resource URL

https://api.quiubas.com/wab/sendmessage

Text

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
messageYesYour text content
agentYesYour WAB Agent

Media Message

Description

Send multimedia messages to a conversation once the user has replied to a template (HSM) or a conversation initiated by the user.

Image

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
captionOptionalThe caption text to be sent along with the media attachment.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "image"
urlYesHTTPS public URL where the image attachment is hosted.

Video

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
captionOptionalThe caption text to be sent along with the media attachment.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "video"
urlYesHTTPS public URL where the video attachment is hosted.

Audio

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "audio"
urlYesHTTPS public URL where the audio attachment is hosted.

Document

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
captionOptionalThe caption text to be sent along with the media attachment.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "document"
urlYesHTTPS public URL where the document attachment is hosted.

Location

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "document"
locationYesThe location payload is in JSON format that contains the latitude, longitude, name, and address (latitude and longitude are required).

Contact Card

ParameterRequiredDescription
numberYesA phone number in E.164 format. Only one recipient for each request is allowed.
agentYesYour WAB Agent
typeYesThe type of message to be sent to the customer. In this case: "document"
contactsYesThe Contacts payload is in JSON format that contains the contact details.

Examples

Template Notification - HSM

Send Template (HSM) Message with ID

$ curl -X POST https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&agent=YOUR_AGENT&id=TEMPLATE_ID'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Send Template (HSM) Message with Variable Content

$ curl -X POST https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&agent=YOUR_AGENT&id=TEMPLATE_ID&message=YOUR_CONTENT'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Customer Support Reply

Text

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&message=MESSAGE&agent=YOUR_AGENT'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Media Template Notification

Image

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&message=MESSAGE&agent=YOUR_AGENT&type=image&url=URL'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Video

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&caption=CAPTION&agent=YOUR_AGENT&type=video&url=URL'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Audio

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&agent=YOUR_AGENT&type=audio&url=URL'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Document

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' -d 'number=PHONE_NUMBER&caption=CAPTION&agent=YOUR_AGENT&type=document&url=URL'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Location

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' --header 'Content-Type: application/json' --data-raw

'{

"number": "PHONE_NUMBER",

"agent": "YOUR_AGENT",

"type": "location"

"location":

{

"longitude": -122.425332,

"latitude": "37.758056",

"name": "Facebook"

"address": "1 Hacker Way, Menlo Park, CA94025",

}

}'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}

Contact Card

$ curl -X PUT https://api.quiubas.com/wab/sendmessage -u
'API_KEY:API_SECRET' --header 'Content-Type: application/json' --data-raw

'{

"number": "PHONE_NUMBER",

"agent": "YOUR_AGENT",

"type": "contacts,"

"contacts": {

"name": {

"first_name": "John",

"formatted_name": "John Smith",

"last_name": "Smith"

},

"phones": [

{

"phone": "+1 (940) 555-1234",

"type": "HOME"

},

{

"phone": "+1 (650) 555-1234",

"type": "WORK"

}

],

"addresses": [

{

"city": "Menlo Park",

"country": "United States",

"country_code": "us",

"state": "CA",

"street": "1 Hacker Way",

"type": "HOME",

"zip": "94025"

},

{

"city": "Menlo Park",

"country": "United States",

"country_code": "us",

"state": "CA",

"street": "200 Jefferson Dr",

"type": "WORK",

"zip": "94025"

}

],

"birthday":"2020-08-18",

"emails": [

{

"email": "test@fb.com",

"type": "WORK"

},

{

"email": "test@whatsapp.com",

"type": "WORK"

}

],

"org": {

"company": "WhatsApp",

"department": "Design",

"title": "Manager"

},

"urls": [

{

"url": "https://www.facebook.com",

"type": "WORK"

}

]

}

}'

Response

{

"error": false,

"number": "PHONE_NUMBER",

"id": "4047108059933515786",

"message": "success",

}