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
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.
Edit a template
Template can be edited when it is Approved, Rejected, or Paused. Edit can be done once per day, and up to 10 times per month.
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.
WhatsApp Flows
Increase interactivity and create streamline processes with your customers using WhatsApp Flows.
Get WhatsApp Flows
Get all the flows for a given sender.
Create Flow
If successful, Flow is created in draft status with default flow.json.
Flow.json contains flow structure which can be modified only if flow is in draft status.
Delete Flow
Only Flows in draft status can be deleted.
Update Flow
Only Flows in draft status can be modified.
Publish Flow
If successful, the Flow change status to published. From now on, the flow cannot be modified.
Deprecate Flow
If successful, the Flow change status to deprecated. From now on, the flow cannot be sent anymore.
Get Flow JSON
Get the Flow JSON attached to a specified flow.
Add Flow JSON
Add WhatsApp Flow JSON. File created from provided JSON content is sent and validated, errors found are provided in response. Regardless of whether any validation errors are returned, the Flow JSON is loaded on the Meta side and the request is considered successful. The maximum size of created file is 10MB. More information about JSON structure can be found under Meta documentation:
WhatsApp Flow Preview
Get Flow's preview URL. Link does not require login and will expire in 30 days.
Send WhatsApp Flow
Send an interactive flow message to a single recipient.
Receive WhatsApp Flow Response
Set up logic for processing incoming messages to customize two-way communication.
Free-form messages
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:
- Text
- Document
- Image
- Audio
- Video
- Sticker
- Location
- Contact
- Interactive lists
- Interactive buttons
- Product message
- Multi-product message
Inbound messages
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:
- Text
- Image
- Audio
- Voice
- Video
- Document
- Location
- Contact
- Button
- Interactive button reply
- Interactive list reply
- Order message
- Other media
- Unsupported Files
You can download incoming media using the API.
Quotes
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.
Delete media
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.
Delivery reports
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