Whatsapp icon integrated with an authentication API, showcased on a green square.

Channel | WhatsApp Business

With more than 2 billion people using WhatsApp around the world to send 60 billion messages every day, the chat app has revolutionized the way we communicate. With an enterprise-grade API, companies can now send notifications and provide customer service through WhatsApp in a secure, reliable, and customer-friendly way.

Creating and sending WhatsApp Stickers

whatsapp sticker 2

Hi there! In this tutorial, you will learn how to create and send WhatsApp stickers in just a few steps. 

API to send stickers to WhatsApp number

The WhatsApp Business API provides an option to send the stickers to your users by calling the chat message API with the following request.

{
    "to": "To_Whatsapp_Number",
    "channels": [
        "whatsapp"
    ],
    "whatsapp": {
        "from": "From_Whatsapp_Number",
        "contentType": "media",
        "media": {
            "type": "sticker",
            "url": "https://www.tyntec.com/sites/default/files/2020-07/tyntec_rocket_sticker_512px_001_.webp"
        }
    }
}

Consideration points when creating WhatsApp stickers

You need to adhere to the general standards of stickers on WhatsApp when creating a sticker file:

  • The sticker file should be a webp file. Note that the animated WebP or stickers are not yet supported in WhatsApp.
  • Stickers are usually images with a transparent background, therefore you must download a background eraser that does the same for your images.
  • A sticker must have an exact 512×512 pixel canvas within which the art must be contained. There must also be a 16-pixel gap between the edge of the sticker art and the border of the canvas.
  • The sticker must be capable of rendering on a wide variety of backgrounds like white, black, coloured and patterned since users tend to have different kinds of WhatsApp chat backgrounds.
  • The size of the sticker file cannot exceed 100KB.

If you adhere to the five points above, you should be able to send out your stickers on WhatsApp phone number. But, even then if it is not getting delivered, it could be because of the following reasons

  • WebP is an image format that uses either (i) the VP8 keyframe encoding to compress image data in a lossy way, or (ii) the WebP lossless encoding (VP8L). Make sure that one of these exists in your webp file. Otherwise, it is an invalid webp. Please consider using some other tool for converting your image.  Check the following section on how to convert your PNG images to WebP.
  • There could be other problems with the structure of the webp file. Get the structure of your webp file by using the EXIV 2 tool on your system. Download from here https://www.exiv2.org/download.html 
  • The webp file should not have XMP metadata.
  • Use command line exiv2 -pS sticker.webp  to fetch the available chunks in the file. 

Valid Chunk Formats allowed by WhatsApp

RIFF/WEBP

+- VP8X (descriptions of features used)

+- ALPH (alpha bitstream)

+- VP8 (bitstream)

RIFF/WEBP

+- VP8X (descriptions of features used)

+- VP8L (lossless bitstream)

RIFF/WEBP

+- VP8X (descriptions of features used)

+- ALPH(alpha bitstream)

+- VP8 (lossless bitstream)

+- EXIF  (metadata)

Valid Chunk Formats NOT allowed by WhatsApp

RIFF/WEBP

+- VP8X (descriptions of features used)

+- ANIM (global animation parameters)

+- ANMF (frame1 parameters + data)

+- ANMF (frame2 parameters + data)

+- ANMF (frame3 parameters + data)

+- ANMF (frame4 parameters + data)

+- EXIF (metadata)

How to convert your PNG images to WebP?

To create stickers for WhatsApp, you must convert your PNG images to WebP. This format usually does a stellar job in retaining image quality alongside reducing the file size which is a preferred state for stickers. You can convert your PNGs to WebP using a few different methods.

  1. https://image.online-convert.com/convert-to-webp (Make sure of the dimension 512*512 px)

  2. You can utilize cwebp, which is a command line conversion tool from google. Here is the link https://developers.google.com/speed/webp/ . Highly suggested. 

  3. You can also install a plugin for Photoshop which allows conversions to WebP.