Panduan pembalasan.id
Messages

Create New Message

POST
/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages

Create a new message in the conversation.

WhatsApp Template Messages

For WhatsApp channels, you can send structured template messages using the template_params field. Templates must be pre-approved in WhatsApp Business Manager.

Example Templates

Text with Image Header:

{
  "content": "Hi your order 121212 is confirmed. Please wait for further updates",
  "template_params": {
    "name": "order_confirmation",
    "category": "MARKETING",
    "language": "en",
    "processed_params": {
      "body": {
        "1": "121212"
      },
      "header": {
        "media_url": "https://picsum.photos/200/300",
        "media_type": "image"
      }
    }
  }
}

Text with Copy Code Button:

{
  "content": "Special offer! Get 30% off your next purchase. Use the code below",
  "template_params": {
    "name": "discount_coupon",
    "category": "MARKETING",
    "language": "en",
    "processed_params": {
      "body": {
        "discount_percentage": "30"
      },
      "buttons": [{
        "type": "copy_code",
        "parameter": "SAVE20"
      }]
    }
  }
}

Authorization

api_access_token<token>

This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.

In: header

Path Parameters

account_id*integer

The numeric ID of the account

conversation_id*integer

The numeric ID of the conversation

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

curl -X POST "https://example.com/api/v1/accounts/0/conversations/0/messages" \  -H "Content-Type: application/json" \  -d '{    "content": "Hello, how can I help you?"  }'
{
  "id": 0,
  "content": "string",
  "account_id": 0,
  "inbox_id": 0,
  "conversation_id": 0,
  "message_type": 0,
  "created_at": 0,
  "updated_at": 0,
  "private": true,
  "status": "sent",
  "source_id": "string",
  "content_type": "text",
  "content_attributes": {},
  "sender_type": "Contact",
  "sender_id": 0,
  "external_source_ids": {},
  "additional_attributes": {},
  "processed_message_content": "string",
  "sentiment": {},
  "conversation": {},
  "attachment": {},
  "sender": {}
}
{
  "description": "string",
  "errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}
{
  "description": "string",
  "errors": [
    {
      "field": "string",
      "message": "string",
      "code": "string"
    }
  ]
}