Skip to main content

Sending a Message

To send a message, replace the following variables in the examples below:

KeyDescription
SENDLIME_API_KEYYour SendLime API key starting with sl_live_ (create one on your dashboard).
TO_NUMBERThe phone number you are sending the message to (E.164 format).
BRAND_ID(Optional) Your approved SMS sender or WhatsApp profile. If omitted, the default sender/profile is used.
info

All API requests are authenticated using a Bearer token in the Authorization header.

Send an SMS

curl -X POST "https://api.sendlime.com/api/v2/messages" \
-H "Authorization: Bearer $SENDLIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "'$TO_NUMBER'",
"message": "A text message sent using the SendLime API",
"channel": "sms",
"brand_id": "'$BRAND_ID'"
}'

Send a WhatsApp message

curl -X POST "https://api.sendlime.com/api/v2/messages" \
-H "Authorization: Bearer $SENDLIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "'$TO_NUMBER'",
"message": "A WhatsApp message sent using the SendLime API",
"channel": "whatsapp"
}'

Check your balance

curl "https://api.sendlime.com/api/v2/balance" \
-H "Authorization: Bearer $SENDLIME_API_KEY"

Fetch message logs

curl "https://api.sendlime.com/api/v2/messages?limit=10" \
-H "Authorization: Bearer $SENDLIME_API_KEY"

Try it out

When you run the example above, the message will be sent to the phone number that you specified.

caution

As per the BTRC guidelines, promotional messages have to be in Bangla.