Send Conversational WhatsApp Messages with OAuth 2.0

Prev Next

WhatsApp Transactional API v2 is a REST API that enables partner systems to send conversational messages through the WhatsApp Business Platform.

To send conversational WhatsApp messages using OAuth 2.0, you must first generate an OAuth 2.0 credential. For step-by-step instructions, refer to OAuth 2.0 Credentials.

Before sending Conversational WhatsApp template messages, make sure you create your template in InOne first. Refer to Create a WhatsApp Business Standard Template on InOne for step-by-step guidance.

Refer to the visual below for an example of how a conversational WhatsApp template message is displayed.

Endpoint

POST https://whatsapp.useinsider.com/v2/conversational/messages/send

Sample Request

Use the request below to send conversational messages via WhatsApp. Apart from templates, message types such as text, media, etc., can also be sent.

{
        "from": "+905551234567",
        "messages": [
        {
        "phone_number": "+905559876543",
        "user_id": "user-uuid-123",
        "message": {
        "type": "text",
        "text": {
        "body": "Merhaba! Size nasıl yardımcı olabilirim?",
        "preview_url": false
        }
        }
        }
        ]
        }
    

Body Parameters

This endpoint shares the same parameters as the Transactional WhatsApp Messages with OAuth 2.0. The primary distinction is that conversational message types, such as text, image, video, document, audio, location, and interactive, are available for the message.type field.

Sample Responses

200 OK

This code indicates that the request has been completed.

{
        "keys": [
        "whatsapp-660e8400-e29b-41d4-a716-446655440001"
        ]
        }
    

Error Codes

These endpoints return the same error codes as the Transactional WhatsApp Messages with OAuth 2.0 (2001, 2002, 2003).

Code

HTTP Status

Description

2001

400

The request body could not be decoded.

2002

400

The request body failed validation.

2003

400

The message could not be sent due to a provider error or an internal system issue.

Media Operation Errors

Code

HTTP Status

Description

2017

400

Provider not found or upload error

2018

400

Error retrieving media information

2019

400

Media download error

INVALID_FILE

400

Invalid file or file could not be read

System Errors

HTTP Status

Description

503 Service Unavailable

The system is currently in maintenance mode