WhatsApp over API
Use the Infobip API for WhatsApp to use WhatsApp as your communication channel.
Follow the Authentication guide to secure your connection with Infobip. To make sure that your incoming traffic is connected to your API, follow the instructions in the Edit Configuration section.
Message templates are messages that are approved by WhatsApp for use outside the permitted messaging window.
Create a template
To create a template, refer to WhatsApp Templates API. You can register the template through this endpoint and upload media files during registration. If you have completed business verification, the template is approved immediately. If you have not completed business verification, you will receive feedback about the template within 24 hours.
For information about the type of content that you can include in the templates, refer to the Message Types section.
Send a template message
To send a template message, all parameters must match. Otherwise, templates will not render correctly on devices.
- The number of placeholders in the templates must match the number of parameters in the template data.
- The number of parameters in the templates must match the number of parameters specified in the API call.
You can send multiple template messages in a single API request.
You can also use a failover to SMS option with your message templates in the case your WhatsApp messages do not reach your customers.
Retrieve a template
Use the API to retrieve your templates, along with their statuses, including whether the template has been approved.
Delete a template
Use the API to delete templates.
You can send free-form messages only within the permitted messaging window. To send messages outside the messaging window, you must use templates that are approved by WhatsApp.
Make sure that you are familiar with messaging limitations and supporting file types before sending any WhatsApp messages.
You can send the following free-form messages over API:
- Interactive lists
- Interactive buttons
- Product message
- Multi-product message
Incoming messages are forwarded to you in real-time when you use WhatsApp for two-way communication.
To enable messages from the Infobip web interface to be forwarded to an API endpoint, you must grant the relevant permission to the API endpoint. Use additional authorization headers to secure connections.
Customers can send you the following types of messages:
- Interactive button reply
- Interactive list reply
- Order message
- Other media
- Unsupported Files
You can download incoming media using the API.
End users can quote messages to indicate that they are replying to that message.
Every incoming message that is quoted by a customer has context, which consists of an
ID, which consists of the
messageId of the quoted message and the
from parameter that indicates the sender number.
Mark as read
Mark incoming messages as read to indicate to your customers that they can expect a response. This feature is not enabled by default. To enable this feature, contact your Infobip Account Manager or our Sales team using the Infobip Contact form.
Media that is sent by customers are cached for 30 days. After this period, the media is deleted automatically. You can delete media manually using the API.
Use the API to track the performance of your communications. The following reports are forwarded to a defined endpoint:
The endpoint is defined in the following locations:
- In the platform at the account-level setting
- (Optional) In the "notifyUrl" field of the API request of a message. If you do not define this endpoint, the reports are forwarded to the endpoint that is defined in the platform