WhatsApp sticker messages can be sent and received through MessageBird WhatsApp channels. These are the requirements/limitations of WhatsApp sticker messages:
In case you don't have the sticker image available in a public URL, you can upload the image to MessageBird using the following request.
curl -X POST https://messaging.messagebird.com/v1/files \-H 'Authorization: AccessKey {your-access-key}' \-H 'Content-Disposition: attachment; filename="{filename.webp}"' \-H 'Content-Type: image/webp' \--data-binary @{filename.webp}
Don't forget to replace {your-access-key} by your live access key, and {filename} by the file name. The HTTP response should look like the following.
{"id":"99449497-535c-46c1-b57c-ddd193edfc5b","name":"{filename.webp}"}
The HTTP response includes the ID of the uploaded file, which can be retrieved using the URL https://messaging.messagebird.com/v1/files/99449497-535c-46c1-b57c-ddd193edfc5b. This URL can be used in the field content.whatsappSticker.link to send the sticker message.
In order to send sticker message, you can use any of the endpoints for sending messages in Conversations API with the message type whatsappSticker. The example below illustrates how to send it using the endpoint POST /v1/send.
curl -X "POST" "https://conversations.messagebird.com/v1/send" \-H 'Authorization: AccessKey {your-access-key}' \-H 'Content-Type: application/json; charset=utf-8' \-d $'{"content": {"whatsappSticker": {"link": "{sticker-image-url}"}},"to": "{destination}","type": "whatsappSticker","from": "{channel-id}"}'
It's important to note the following:
The HTTP response code should be 200 OK, and the response body should contain the message ID.
{"id": "3b75218770cs44dha3je77896fa86d62","status": "accepted"}
Optionally, you can use the endpoint for fetching message details (GET /v1/messages/{id}).
curl "https://conversations.messagebird.com/v1/messages/3b75218770cs44dha3je77896fa86d62" \-H 'Authorization: AccessKey {your-access-key}' \-H 'Content-Type: application/json; charset=utf-8'
The HTTP response should look like the following.
{"id": "3b75218770cs44dha3je77896fa86d62","conversationId": "0b7c237df609487c9c41437tab502889","platform": "whatsapp","to": "+31600000000","from": "+31600000000","channelId": "54d17af6-98be-42u3-420c-4e98d04f023c","type": "whatsappSticker","content": {"whatsappSticker": {"link": "https://messaging.messagebird.com/v1/files/99449497-535c-46c1-b57c-ddd193edfc5b"}},"direction": "sent","status": "delivered","createdDatetime": "2021-11-19T16:24:53.00257632Z","updatedDatetime": "2021-11-19T16:24:57Z"}