Dieses Dokument wurde aktualisiert.
Die Übersetzung ins Deutsche ist noch nicht fertig.
Englisch aktualisiert: 14. Nov.
Deutsch aktualisiert: 11.12.2023

Wir stellen die On-Premises API ein. Weitere Informationen und wie du auf unsere Cloud API der nächsten Generation migrieren kannst, findest du in unserem Dokument zur Einstellung der On-Premises API.

We are making changes to the WhatsApp Business Platform pricing model. See Pricing Updates on the WhatsApp Business Platform.

Messages

/v1/messages

Use the messages node to send text, media, contacts, locations, and interactive messages, as well as message templates to your customers.

See the following guides for information regarding the specific types of messages you can send: Text Messages, Media Messages, Contacts and Location Messages, Interactive Messages, Message Templates, Media Message Templates, and Interactive Message Templates.

Before You Start

You need:

  • Authenticate yourself and receive an authentication token that enables you to access the service. See the Login and Authentication documentation for more information on how to do this.
  • To verify the WhatsApp account you wish to message and get its WhatsApp user ID, See the Contacts documentation for more information on how to do this.
  • Meet the cut-off control service requirements for messages.

Starting in v2.39 and above, you do not have to call the contacts node before sending a message.

Constraints

  • The following types of message are supported: text, message templates, images, documents and audio.
  • A text message can be a max of 4096 characters long.

Creating

You send messages by making a POST call to the /messages node regardless of message type. The content of the JSON message body differs for each type of message (text, image, etc.).

Parameters

These are the main parameters used in /messages POST requests:

NameBeschreibung (Klicke für unterstützte Optionen auf den Pfeil in der linken Spalte.)

audio

Objekt

Erforderlich, wenn type=audio ist.

Ein media-Objekt, das Audio enthält.

biz_opaque_callback_data

String

Optional.

Ein beliebiger String für das Tracking.


Du kannst beispielsweise die Nachrichtenvorlagen-ID in diesem Feld übergeben, um den Verlauf deines*deiner Kund*in ab der ersten von dir gesendeten Nachricht zu tracken. Anschließend kannst du den ROI verschiedener Nachrichtenvorlagentypen tracken, um den effektivsten Typ zu ermitteln.


Jede App, die das Webhook-Feld messages im WhatsApp-Unternehmenskonto abonniert hat, kann diesen String abrufen, da er im Objekt statuses in den Webhook-Payloads enthalten ist.


Die Cloud API verarbeitet dieses Feld nicht, sondern gibt es nur als Teil der Webhooks für gesendete/zugestellte/gelesene Nachrichten zurück.


Maximal 512 Zeichen.


Nur Cloud API.

contacts

Objekt

Erforderlich, wenn type=contacts ist.

Ein contacts-Objekt .

context

Objekt

Erforderlich, wenn auf eine Nachricht in der Unterhaltung geantwortet wird.

Ein Objekt, das die ID einer vorherigen Nachricht enthält, auf die du antwortest. Beispiel:


{"message_id":"MESSAGE_ID"}


Nur Cloud API.

document

Objekt

Erforderlich, wenn type=document ist.

Das media-Objekt, das ein Dokument enthält.

hsm

Objekt

Enthält ein hsm-Objekt. Diese Option wurde in Version v2.39 der On-Premises API eingestellt. Verwende stattdessen das template-Objekt.


Nur On-Premises API.

image

Objekt

Erforderlich, wenn type=image ist.

Ein media-Objekt, das ein Bild enthält.

interactive

Objekt

Erforderlich, wenn type=interactive ist.

Ein interactive-Objekt. Die Komponenten jedes interactive-Objekts folgen im Allgemeinen einem einheitlichen Muster: header, body, footer und action.

location

Objekt

Erforderlich, wenn type=location ist.

Ein location-Objekt.

messaging_product

String

Erforderlich

Messaging-Dienst, der für die Anfrage verwendet wird. Verwende "whatsapp".


Nur Cloud API.

preview_url

Boolescher Wert

Erforderlich, wenn type=text ist.

Ermöglicht eine URL-Vorschau in SMS-Nachrichten – weitere Informationen unter URLs in SMS-Nachrichten senden. Dieses Feld ist optional, wenn du keine URL in deine Nachricht einfügst. Werte:false (Standard), true.


Nur On-Premises API. Cloud API-Benutzer*innen können dieselbe Funktionalität mit dem preview_url-Feld innerhalb eines „text“-Objekts verwenden.

recipient_type

String

Optional.

Derzeit kannst du nur Nachrichten an Einzelpersonen senden. Lege hierfür individual fest.


Standard: individual

status

String

Der Status einer Nachricht. Mit diesem Feld kannst du eine Nachricht als read markieren. Weitere Informationen findest du in den folgenden Leitfäden:


sticker

Objekt

Erforderlich, wenn type=sticker ist.

Ein media-Objekt, das ein Sticker enthält.


Cloud API: Zusätzlich zu allen Typen von eingehenden Stickern werden statische und animierte ausgehende Sticker von Drittanbietern unterstützt. Ein statischer Sticker muss 512 x 512 Pixel groß sein und darf 100 KB nicht überschreiten. Ein animierter Sticker muss 512 x 512 Pixel groß sein und darf 500 KB nicht überschreiten.


On-Premises API: Zusätzlich zu allen Typen eingehender Stickern werden nur statische ausgehende Sticker von Drittanbietern unterstützt. Ein statischer Sticker muss 512 x 512 Pixel groß sein und darf 100 KB nicht überschreiten. Animierte Sticker werden nicht unterstützt.

template

Objekt

Erforderlich, wenn type=template ist.

Ein template-Objekt.

text

Objekt

Erforderlich für SMS.

Ein text-Objekt.

to

String

Erforderlich.

Die WhatsApp-ID oder Telefonnummer des*der Kund*in, an den/die du die Nachricht senden möchtest. Siehe Formate von Telefonnummern.


Bei Bedarf können On-Premises-API-Benutzer*innen diese Nummer abrufen, indem sie den contacts-Endpunkt aufrufen.

type

String

Optional.

Der Typ der Nachricht, die du senden möchtest. Wenn nicht angegeben, ist der Standardwert text.

Text Object

NameDescription

body

Required.

Contains the text of the message, which can contain URLs and formatting.

Media Object

For the On-Premises API, the media object id is returned when the media is successfully uploaded to the WhatsApp Business on-premises/reference client via the media endpoint.

NameDescription

id

string

Required when type is audio, document, image, sticker, or video and you are not using a link.


The media object ID. Do not use this field when message type is set to text.

link

string

Required when type is audio, document, image, sticker, or video and you are not using an uploaded media ID (i.e. you are hosting the media asset on your public server).

The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.


Do not use this field when message type is set to text.


Cloud API users only:


  • See Media HTTP Caching if you would like us to cache the media asset for future messages.
  • When we request the media asset from your server you must indicate the media's MIME type by including the Content-Type HTTP header. For example: Content-Type: video/mp4. See Supported Media Types for a list of supported media and their MIME types.

caption

string

Optional.


Media asset caption. Do not use with audio or sticker media.


On-Premises API users:

  • For v2.41.2 or newer, this field is is limited to 1024 characters.
  • Captions are currently not supported for document media.

filename

string

Optional.


Describes the filename for the specific document. Use only with document media.


The extension of the filename will specify what format the document is displayed as in WhatsApp.

provider

string

Optional. On-Premises API only.

This path is optionally used with a link when the HTTP/HTTPS link is not directly accessible and requires additional configurations like a bearer token. For information on configuring providers, see the Media Providers documentation.

Contacts Object

Inside contacts, you can nest the following objects: addresses, emails, name, org, phone, and urls. Pluralized objects are to be wrapped in an array as shown in the example below.

NameDescription

addresses

object

Optional.

Full contact address(es) formatted as an addresses object. The object can contain the following fields:

streetstringOptional. Street number and name.

citystringOptional. City name.

statestringOptional. State abbreviation.

zipstringOptional. ZIP code.

countrystringOptional. Full country name.

country_codestringOptional. Two-letter country abbreviation.

typestringOptional. Standard values are HOME and WORK.

birthday

Optional.

YYYY-MM-DD formatted string.

emails

object

Optional.

Contact email address(es) formatted as an emails object. The object can contain the following fields:

emailstringOptional. Email address.

typestringOptional. Standard values are HOME and WORK.

name

object

Required.

Full contact name formatted as a name object. The object can contain the following fields:

formatted_namestringRequired. Full name, as it normally appears.

first_namestringOptional*. First name.

last_namestringOptional*. Last name.

middle_namestringOptional*. Middle name.

suffixstringOptional*. Name suffix.

prefixstringOptional*. Name prefix.


*At least one of the optional parameters needs to be included along with the formatted_name parameter.

org

object

Optional.

Contact organization information formatted as an org object. The object can contain the following fields:

companystringOptional. Name of the contact's company.

departmentstringOptional. Name of the contact's department.

titlestringOptional. Contact's business title.

phones

object

Optional.

Contact phone number(s) formatted as a phone object. The object can contain the following fields:

phonestringOptional. Automatically populated with the `wa_id` value as a formatted phone number.

typestringOptional. Standard Values are CELL, MAIN, IPHONE, HOME, and WORK.

wa_idstringOptional. WhatsApp ID.

urls

object

Optional.

Contact URL(s) formatted as a urls object. The object can contain the following fields:

urlstringOptional. URL.

typestringOptional. Standard values are HOME and WORK.

Example of a contacts object with pluralized objects nested inside:

"contacts": [
    {
        "addresses": [
            {
                "city": "city name",
                "country": "country name",
                "country_code": "code",
                "state": "Contact's State",
                "street": "Contact's Street",
                "type": "Contact's Address Type",
                "zip": "Contact's Zip Code"
            }
        ],
        "birthday": "birthday",
        "emails": [
            {
                "email": "email",
                "type": "HOME"
            },
            {
                "email": "email",
                "type": "WORK"
            }
        ],
        "name": {
            "first_name": "first name value",
            "formatted_name": "formatted name value",
            "last_name": "last name value",
            "suffix": "suffix value"
        },
        "org": {
            "company": "company name",
            "department": "dep name",
            "title": "title"
        },
        "phones": [
            {
                "phone": "Phone number",
                "wa-id": "WA-ID value",
                "type": "MAIN"
            },
            {
                "phone": "Phone number",
                "type": "HOME"
            },
            {
                "phone": "Phone number",
                "type": "WORK"
            }
        ],
        "urls": [{
            "url": "some url",
            "type": "WORK"
        }]
    }
]

Location Object

NameDescription

latitude

Required.

Location latitude in decimal degrees.

longitude

Required.

Location longitude in decimal degrees.

name

Required.

Name of the location.

address

Required.

Address of the location.

Template Object

Inside template, you can nest the components and the language objects.

Beginning in v2.27.8, a template's namespace must be the namespace associated with the WABA that owns the phone number in the current WhatsApp Business on-prem client. Otherwise, the message will fail to send.

In addition, from v2.41 and onwards, namespace will be an optional field.

NameDescription

name

Required.

Name of the template.

language

object

Required.

Contains a language object. Specifies the language the template may be rendered in.


The language object can contain the following fields:

policystringRequired. The language policy the message should follow. The only supported option is deterministic. See Language Policy Options.

codestringRequired. The code of the language or locale to use. Accepts both language and language_locale formats (e.g., en and en_US). For all codes, see Supported Languages.

components

array of objects

Optional.

Array of components objects containing the parameters of the message.

namespace

Optional. Only used for On-Premises API.

Namespace of the template.

Components Object

Inside components, you can nest the parameters object. Additionally, you can set type to button.

NameDescription (Click the arrow in the left column for supported options.)

type

string

Required.

Describes the component type.


Example of a components object with an array of parameters object nested inside:

 "components": [{
   "type": "body",
   "parameters": [{
                "type": "text",
                "text": "name"
            },
            {
            "type": "text",
            "text": "Hi there"
            }]
      }] 

Supported Options

  • header
  • body
  • button

For text-based templates, we only support the type=body.

sub_type

string

Required when type=button. Not used for the other types.

Type of button to create.

Supported Options

  • quick_reply: Refers to a previously created quick reply button that allows for the customer to return a predefined message.
  • url: Refers to a previously created button that allows the customer to visit the URL generated by appending the text parameter to the predefined prefix URL in the template.
  • catalog: Refers to a previously created catalog button that allows for the customer to return a full product catalog.

parameters

array of objects

Required when type=button.

Array of parameter objects with the content of the message.

For components of type=button, see the button parameter object.

index

Required when type=button. Not used for the other types.

Position index of the button. You can have up to 10 buttons using index values of 0 to 9.

Parameter Object

NameDescription

type

Required.

Describes the parameter type.
Values: text, currency, date_time, image, document, video


Example of a parameter object with a text value:

{
    "type": "text",
    "text": "Customer"
}

Example of a parameter object with a media type value of document:

{
    "type": "document",
    "document":{
        "id": "doc_id",
        "filename": "doc_name"
    }
}

This is also known as a Media message template and they only support PDF documents.


For more information about currency and date_time, see the Localizable Parameters section.

Button Type

Inside the components object, you can set type to button. These are the button parameters:

NameDescription

sub_type

Required.

Type of button being created.
Values: quick_reply, url, copy_code (available from 2.49 and onwards)

index

Required.

Position index of the button. You can have up to 10 buttons using index values of 0-9.

parameters

Required.

The parameters for the button, which are set at creation time in your Business Manager. Include the following parameters:

  • type (Required): Indicates the type of parameter for the button. Supported values are payload , text and coupon_code.
  • payload (Required for quick_reply buttons): Developer-defined payload that will be returned when the button is clicked in addition to the display text on the button.
  • text (Required for url buttons): Developer provided suffix that will be appended to a previously created dynamic URL button.
  • coupon_code (Required for copy_code buttons) (available from 2.49 and onwards): Developer provided coupon code which gets copied when the copy code button is clicked.

Example of button type with sub_type quick_reply:

 {
    "type": "button",
    "sub_type": "quick_reply",
    "index": 0,
    "parameters": 
     [{
    	"type": "payload",
    	"payload": "Yes-Button-Payload"
     }]
 } 

Example of button type with sub_type copy_code

    
 { 
    "type": "button", 
    "sub_type": "copy_code", 
    "index": 0, 
    "parameters": 
    [{ 
     "type": "coupon_code", 
     "coupon_code": "DISCOUNT20" 
    }] 
 }

Hsm Object

The hsm object has been deprecated with v2.39 of the WhatsApp Business on-premises/reference. Please use the template object instead.

Name Description

namespace

Required.

The namespace to be used. Beginning with v2.2.7, if the namespace does not match up to the element_name, the message fails to send.

element_name

Required.

The element name that indicates which template to use within the namespace. Beginning with v2.2.7, if the element_name does not match up to the namespace, the message fails to send.

language

Required.

Allows for the specification of a deterministic language. See the Language section for more information.


This field used to allow for a fallback option, but this has been deprecated with v2.27.8.

localizable_params

Required.

This field is an array of values to apply to variables in the template. See the Localizable Parameters section for more information.

Interactive Object

The interactive object generally contains 4 main components: header, body, footer, and action. Additionally, some of those components can contain one or more different objects:

  • Inside header, you can nest media objects.
  • Inside action, you can nest section and button objects.
NameDescription

type

string

Required.

The type of interactive message you want to send. Supported values:

  • list: Use it for List Messages.
  • button: Use it for Reply Buttons.
  • product: Use it for Single-Product Messages.
  • product_list: Use it for Multi-Product Messages.
  • catalog_message: Use it for Catalog Messages.
  • flow: Use it for Flows Messages.

header

object

Required for type product_list. Optional for other types.

Header content displayed on top of a message. You cannot set a header if your interactive object is of product type.


The header object contains the following fields:

documentobjectRequired if type is set to document. Contains the media object with the document.

imageobjectRequired if type is set to image. Contains the media object with the image.

videoobjectRequired if type is set to video. Contains the media object with the video.

textstringRequired if type is set to text. Text for the header. Formatting allows emojis, but not markdown. Maximum length: 60 characters.

typestringRequired. The header type you would like to use. Supported values are:

text – for List Messages, Reply Buttons, and Multi-Product Messages.

video – for Reply Buttons.

image – for Reply Buttons.

document – for Reply Buttons.

body

object

Optional for type product. Required for other message types.

An object with the body of the message.


The body object contains the following field:

textstringRequired if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters.

footer

object

Optional.

An object with the footer of the message.


The footer object contains the following field:

textstringRequired if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters.

action

object

Required.

An action object with what you want the user to perform after reading the message. See action object for full information.

Action Object

NameDescription

button

string

Required for List Messages.

Button content. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

buttons

object

Required for Reply Button Messages.

A button object. The object can contain the following parameters:

type – The only supported option is reply for Reply Button Messages.

title – Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

id – Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.


Wenn du die ID festlegst, darf sie nicht mit einem Leerzeichen beginnen oder enden.

sections

array of objects

Required for List Messages and Multi-Product Messages.

Array of section objects. There is a minimum of 1 and maximum of 10. See section object.

catalog_id

string

Required for Single-Product Messages and Multi-Product Messages.

Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via Commerce Manager.

product_retailer_id

string

Required for Single-Product Messages and Multi-Product Messages.

Unique identifier of the product in a catalog. Maximum 100 characters for both Single-Product and Multi-Product messages.


To get this ID, go to Commerce Manager, select your Facebook Business account, and you will see a list of shops connected to your account. Click the shop you want to use. On the left-side panel, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

mode

string

Optional for Flows Messages.

The current mode of the Flow, either draft or published.


Default: published

flow_message_version

string

Required for Flows Messages.

Must be 3.

flow_token

string

Required for Flows Messages.

A token that is generated by the business to serve as an identifier.

flow_id

string

Required for Flows Messages.

Unique identifier of the Flow provided by WhatsApp.

flow_cta

string

Required for Flows Messages.

Text on the CTA button, eg. "Signup".


Maximum length: 20 characters (no emoji).

flow_action

string

Optional for Flows Messages.

navigate or data_exchange. Use navigate to predefine the first screen as part of the message. Use data_exchange for advanced use-cases where the first screen is provided by your endpoint.


Default: navigate

flow_action_payload

object

Optional for Flows Messages.

Required only if flow_action is navigate. The object can contain the following parameters:

screenstringRequired. The id of the first screen of the Flow.

dataobjectOptional. The input data for the first screen of the Flow. Must be a non-empty object.

Section Object

NameDescription

title

string

Required if the message has more than one section.

Title of the section. Maximum length: 24 characters.

rows

array of objects

Required for List Messages.

Contains a list of row objects. Limited to 10 rows across all sections.


Each row object contains the following fields:

titlestringRequired. Maximum length: 24 characters.

IDstringRequired. Maximum length: 200 characters.

descriptionstringOptional. Maximum length: 72 characters.

product_items

array of objects

Required for Multi-Product Messages.

Array of product objects. There is a minimum of 1 product per section and a maximum of 30 products across all sections.


Each product object contains the following field:

product_retailer_idstringRequired for Multi-Product Messages. Unique identifier of the product in a catalog. To get this ID, go to Commerce Manager, select your account and the shop you want to use. Then, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name.

Examples

Audio messages:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "audio",
  "audio": {
      "id": "your-media-id",
  }
}

Document messages, using filename:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "document",
  "document": {
      "id": "your-media-id",
      "filename": "your-document-filename"
  }
}

Document messages, using link:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "document",
  "document": {
      "link": "http(s)://the-url"
      "provider": {
          "name" : "provider-name"
      }     
    }
}

Video messages, using link:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "video",  
  "video": {
      "link": "http(s)://the-url"
      "provider": {
          "name" : "provider-name"
      }
    }
  }
}

Text messages:

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "text",
  "text": {
      "body": "your-message-content"
  }
}

Interactive messages (lists):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "interactive",
  "interactive":{
    "type": "list",
    "header": {
      "type": "text",
      "text": "your-header-content-here"
    },
    "body": {
      "text": "your-text-message-content-here"
    },
    "footer": {
      "text": "your-footer-content-here"
    },
    "action": {
      "button": "cta-button-content-here",
      "sections":[
        {
          "title":"your-section-title-content-here",
          "rows": [
            {
              "id":"unique-row-identifier-here",
              "title": "row-title-content-here",
              "description": "row-description-content-here",           
            }
          ]
        },
        {
          "title":"your-section-title-content-here",
          "rows": [
            {
              "id":"unique-row-identifier-here",
              "title": "row-title-content-here",
              "description": "row-description-content-here",           
            }
          ]
        },
        ...
      ]
    }
  }

}

Interactive messages (reply buttons):

POST /v1/messages
{
  "recipient_type": "individual",
  "to": "whatsapp-id",
  "type": "interactive",
  "interactive": {
    "type": "button",
    "header": { # optional
      "type": "text" | "image" | "video" | "document",
      "text": "your text"
      # OR
      "document": {
        "id": "your-media-id",
        "filename": "some-file-name"
      }
      # OR
      "document": {
        "link": "the-provider-name/protocol://the-url",
        "provider": {
          "name": "provider-name",
        },
        "filename": "some-file-name"
      },
      # OR
      "video": {
        "id": "your-media-id"
      }
      # OR
      "video": {
        "link": "the-provider-name/protocol://the-url",
        "provider": {
          "name": "provider-name"
        }
      }
      # OR
      "image": {
        "id": "your-media-id"
      }
      # OR
      "image": {
        "link": "http(s)://the-url",
        "provider": {
          "name": "provider-name"
        }
      }
    }, # end header
    "body": {
      "text": "your-text-body-content"
    },
    "footer": { # optional
      "text": "your-text-footer-content"
    },
    "action": {
      "buttons": [
        {
          "type": "reply",
          "reply": {
            "id": "unique-postback-id",
            "title": "First Button’s Title" 
          }
        },
        {
          "type": "reply",
          "reply": {
            "id": "unique-postback-id",
            "title": "Second Button’s Title" 
          }
        }
      ] 
    } # end action   
  } # end interactive

}

Interactive messages (Multi and Single-Product Messages):

{ 
  "recipient_type": "individual",
  "to" : "{{Recipient-WA-ID}}",
  "type": "interactive",
  "interactive": {
    "type": "product",
    "body": {
      "text": "body text"
    },
    "footer": {
      "text": "footer text"
    },
    "action": {
      "
      
      _id": "catalog-ID",
      "product_retailer_id": "product-ID"
    }
  }
}

Interactive messages (Multi-Product Messages):

{ 
  "recipient_type": "individual",
  "to" : "whatsapp-id",
  "type": "interactive",
  "interactive": 
    {
    "type": "product_list",
    "Header":{
       "type": "text",
        "text": "text-header-content"
     },
     "body":{
        "text": "text-body-content"
      },
     "footer":{
        "text":"text-footer-content"
     },
     "action":{
        "catalog_id":"catalog-id",
        "sections": [
             {
             "title": "section-title",             
             "product_items": [
                  { "product_retailer_id": "product-SKU-in-catalog" },
                  { "product_retailer_id": "product-SKU-in-catalog" },
                            ...
              ]},
              {
              "title": "the-section-title",
              "product_items": [
                 { "product_retailer_id": "product-SKU-in-catalog" }
                           ...
              ]},
               ...
       ]
     },  
    }
}

Interactive messages (Catalog Messages):

{ 
  "recipient_type": "individual",
  "to" : "whatsapp-id",
  "type": "interactive",
  "interactive": 
    {
    "type": "catalog_message",
     "body":{
        "text": "text-body-content"
      },
     "footer":{
        "text":"text-footer-content"
     },
     "action":{
        "name": "catalog_message",
      	"parameters":{ 
      	  "thumbnail_product_retailer_id": "product-SKU-in-catalog"
      	}
     },  
    }
}

Interactive messages (Flows):

{
  "recipient_type": "individual",
  "to": "{{Recipient-WA-ID}}",
  "type": "interactive",
  "interactive": {
    "type": "flow",
    "header": {
      "type": "text",
      "text": "Flow message header"
    },
    "body": {
      "text": "Flow message body"
    },
    "footer": {
      "text": "Flow message footer"
    },
    "action": {
      "name": "flow",
      "parameters": {
        "flow_message_version": "3",
        "flow_token": "AQAAAAACS5FpgQ_cAAAAAD0QI3s",
        "flow_id": "<FLOW_ID>",
        "flow_cta": "Book!",
        "flow_action": "navigate",
        "flow_action_payload": {
          "screen": "<SCREEN_ID>",
          "data": { # optional
            "user_name": "name",
            "user_age": 25
          }
        }
      }
    }
  }
}

The following shows an example of payload in a response; the meta and error objects are omitted for brevity.

{
  "messages": [{ 
    "id": "message-id" 
  }]    
}

If the request is successful, you receive a response with a message ID. If the request returns an errors section, check the originating message and correct the errors before resending the request. For more information about errors, see WhatsApp Business on-premises/reference Client Error Codes and HTTP Status Codes.

Applies to businesses in Brazil, Colombia, and Singapore, starting September 12, 2023. Applies to all businesses starting October 12, 2023.

If the request is held for quality assessment, the response will contain a message_status property with a message indicating that the message was not sent immediately and will be sent or dropped after quality has been validated. This property will only exist if the message is held.

    {
      "messages": [{ 
        "id": "message-id",
        "message_status": "Message has been held because quality assessment is pending",
      }]    
    }
    

Formatting in Text Messages

WhatsApp allows some formatting in messages. To format all or part of a message, use these formatting symbols:

FormattingSymbolExample

Bold

Asterisk (*)

Your total is *$10.50*.

Italics

Underscore (_)

Welcome to _WhatsApp_!

Strike-through

Tilde (~)

This is ~better~ best!

Code

Three backticks (```)

```print 'Hello World';```

Performance

In this context, performance represents the number of messages that can be sent in any given second using the WhatsApp Business on-premises/reference client. The maximum achievable performance depends on a variety of factors, the most important factor being your client setup choice and whether a message is being sent to a new user or an existing user —encryption sessions setup take a little longer when messaging a new user.

Client SetupSupported Text Messages Per Second

Single Shard

70

Multi Shard (32 shards)

250

FAQ

Hinweis: Bitte sende eine Nachricht nicht mehrmals über die WhatsApp Business API an denselben*dieselbe Empfänger*in.

Es kann mehrere Ursachen haben, wenn die Auslieferungsrate nicht 100 % beträgt. Beispielsweise kann es sein, dass Benutzer*innen nur sporadisch Zugriff auf das Netzwerk haben, für einen längeren Zeitraum nicht aktiv sind oder dass ein hochwertiges Nutzungserlebnis gewährleistet werden soll.

Nachrichten, die mit WhatsApp ausgeliefert werden können, haben eine sehr hohe Auslieferungsrate. Es gibt jedoch viele Gründe, warum eine Nachricht nicht ausgeliefert wird. Durch Verfolgen deiner Rückrufe hast du Zugriff auf den genauen Status einer Nachricht. Darin liegt beispielsweise der Unterschied zum Senden von Nachrichten per SMS, wo du keinen Zugriff auf den endgültigen Auslieferungsstatus hast und durch erneutes Senden der Nachricht möglicherweise tatsächlich ein anderes Ergebnis entsteht.

Nachrichten gelten womöglich weiterhin als „nicht ausgeliefert“, weil das Telefon eines*einer Benutzer*in außer Betrieb ist, der Akku leer ist oder der*die Benutzer*in es verloren hat, sich daraufhin ein neues Telefon gekauft und die SIM-Karte deaktiviert hat. Denkbar ist auch, dass der Unternehmenskunde beim Herstellen der Verbindung mit dem Netzwerk Fehlermeldungen erhalten hat. Es ist außerdem möglich, dass Rückrufe (Webhooks) nicht ausgeliefert werden. Diese Fälle kannst du mit dem Node health überwachen. Durch Aktivieren von Server-Empfangsrückrufen hast du die Gewissheit, dass die Nachricht in der WhatsApp-Server-Cloud angekommen ist.

Wenn ein*e Benutzer*in erneut eine Verbindung mit dem Netzwerk herstellt, werden alle von dir gesendeten Nachrichten ausgeliefert. Bei dem*der Benutzer*in kommt es nicht gut an, wenn er mehrere Nachrichten mit demselben Inhalt erhält. Die Wahrscheinlichkeit steigt, dass der*die Benutzer*in dich blockiert oder sich über dich beschwert. Auch eine Sperrung wird wahrscheinlicher.

Wenn du eine Nachricht sendest und von der API eine Nachrichten-ID erhältst, hast du alles Nötige getan, um diese Nachricht zu senden. Du solltest denselben Inhalt nicht erneut an denselben Empfänger senden.

Wenn die Auslieferungsrate über einen längeren Zeitraum niedrig ist, öffne ein Support-Ticket beim Direct Support.

Wenn du eine Nachricht sendest und eine Nachrichten-ID erhältst, bedeutet das, dass die Nachrichtenanforderung in der Datenbank gespeichert wurde. Der WhatsApp Business API-Client versucht weiterhin, diese Nachricht zu senden, bis der Vorgang vom WhatsApp-Server bestätigt wird. Dieser Prozess ist nicht zeitlich begrenzt. Der WhatsApp-Server versucht dann, diese Nachricht an das Telefon des Nutzers zu übermitteln. Wenn das Telefon des Benutzers nicht online ist, wird die Nachricht 30 Tage lang gespeichert, bevor sie vom WhatsApp-Server entfernt wird.

Ja. Mit WhatsApp kannst du ausgewählten Text in deinen Nachrichten mit Fett, Kursiv, Durchgestrichen und Monospace formatieren.

Es gibt derzeit keine Möglichkeit zu sehen, wie viele oder welche Benutzer dein Unternehmen blockieren. Eine gute Möglichkeit, dies herauszufinden, ist, auf Status-Rückrufe zu warten. Wenn du den Status delivered nicht erhältst, hat der Nutzer dein Unternehmen entweder blockiert oder er hat keine Verbindung zum Netzwerk. Weitere Informationen findest du in der Dokumentation zu Webhooks.

Wenn ein Nutzer dein Unternehmen gesperrt hat, wird diese Telefonnummer von der Kontakte-API weiterhin als ein gültiger WhatsApp-Nutzer zurückgegeben. Wenn du die Nachricht sendest, wird sie allerdings niemals zugestellt. Handelt es sich dabei um eine bezahlte Nachricht, fallen keine Kosten an.

Nein. Es wird nicht garantiert, dass Nachrichten in der Reihenfolge ankommen, in der sie gesendet wurden. Wenn die richtige Reihenfolge für deinen Anwendungsfall wichtig ist, schlagen wir vor, den „Zugestellt“-Rückruf abzuwarten, bevor du die zweite Nachricht sendest.

Bei Verwendung des messages-Node musst du den Content-Type-Header auf application/json festlegen, damit der Nachrichtentext von WhatsApp Business API-Client richtig geparst wird. Es gibt auch einen Authorization-Header, der festgelegt werden und einen nicht abgelaufenen Zugriffsschlüssel enthalten muss. Informationen dazu, wie du den Zugriffsschlüssel abrufen kannst und wann er abläuft, findest du in der Dokumentation zu Anmeldung und Authentifizierung

Es kann sein, dass du mehr Zeit benötigst, um eine Kundenanfrage zu bearbeiten, und du daher erst später als nach 24 Stunden antworten kannst. Wir empfehlen, Nachrichtenvorlagen zu erstellen, um:

  • das Ergebnis an den Nutzer auszuliefern oder
  • den Nutzer zu einer Antwort aufzufordern, damit das Kundenservice-Fenster aktiviert wird.

In beiden Fällen solltest du der Nachrichtenvorlage möglichst viel Kontext hinzufügen. Beispiel:

  • „Hallo {{1}}, hinsichtlich des kürzlich gemeldeten Problems müssen wir dir leider mitteilen, dass {{2}}. Wir entschuldigen uns für etwaige Unannehmlichkeiten.“
  • „Es gibt Neuigkeiten zu deinem Ticket. Bitte antworte auf diese Nachricht, wenn du weiterhin Support wünschst.“