logo
enes

Text messages

Last update: 6 hours ago by Irais Aguirre

Integration summary

  • Endpoint: POST https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging
  • Token: messaging token, in the Authorization: Bearer {{wa-msg-api-token}} header (how to generate it)
  • Common fields: from, to (phone number or BSUID) and type (details)
  • type values on this page: "text"
  • Response: the same for every message (see response)

Free-form text messages, with or without a URL preview. All are sent with POST /v1/messaging; headers, common fields and the response are in HTTP connection.

Text

Sends a text message. The type field must be "text".

Body

Fields for Text, in addition to the common fields:

NameDescriptionTypeRequirements
textMessage text.String
  • Required.
  • Maximum length: 4096 characters.

Example

Complete Text example (HTTP request and JSON body):

HTTP request

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"type": "text",
"text": "~Strikethrough text~ \n _Italic text_ \n *Bold text* \n Emojis ๐Ÿ˜‹"
}'

Body

{
"from": "5215500000001",
"to": "5215500000002",
"type": "text",
"text": "~Strikethrough text~ \n _Italic text_ \n *Bold text* \n Emojis ๐Ÿ˜‹"
}


Text with URL preview

Sends a text message with a preview of the URL it contains. The type field must be "text".

Body

Fields for Text with URL preview, in addition to the common fields:

NameDescriptionTypeRequirements
textMessage text.String
  • Required.
  • Maximum length: 4096 characters.
preview_urltrue to show a preview of the first URL in text. Default false.BooleanOptional.

Example

Complete Text with URL preview example (HTTP request and JSON body):

HTTP request

curl -X POST 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "5215500000002",
"type": "text",
"text": "https://www.ejemplo.com",
"preview_url": true
}'

Body

{
"from": "5215500000001",
"to": "5215500000002",
"type": "text",
"text": "https://www.ejemplo.com",
"preview_url": true
}


Text with BSUID

Send the message to the user's BSUID in the to field. See Usernames and BSUID.

Uses the same fields as Text; the type field must be "text".

Example

Complete Text with BSUID example (HTTP request and JSON body):

HTTP request

curl --location 'https://{{url}}/whatsapp-bsp-api-endpoint-ws/services/v1/messaging' \
-H 'Authorization: Bearer {{wa-msg-api-token}}' \
-H 'Content-Type: application/json' \
-d '{
"from": "5215500000001",
"to": "US.13491208655302741918",
"type": "text",
"text": "Hello"
}'


WhatsApp โ€” Previous
Non-template messages
Next
Media