API Reference
DOKU DocsChangelogDOKU Github
  • Getting Started with DOKU API
    • User Registration
    • Idempotency Request
    • Notification
      • Setup Notification URL
      • HTTP Notification Sample for SNAP
      • HTTP Notification Sample - Non SNAP
      • Best Practice
      • Retry Notification
      • Override Notification URL
    • Signature Component
      • Non-SNAP
        • Signature Component from Request Header
        • Signature Componen from Response Header
        • Signature from API Get Method
        • Sample Code
      • SNAP
        • Symmetric Signature
        • Asymmetric Signature
    • Response Code
      • HTTP Status and Case Code
    • Check Status API
      • Non-SNAP
      • SNAP
    • Retrieve Payment Credential
  • Accept Payment
    • DOKU Checkout
      • Integration Guide
        • Backend Integration
        • Frontend Integration
        • Simulate payment and Notification
      • Supported Payment Methods
      • Status Order
      • Additional Feature
        • Tokenization
        • Promo on DOKU Checkout Page
        • Track Campaign Source on Google Analytics
      • Checkout Settings
    • Direct API
      • Non-SNAP
        • Cards
          • Payment Page Integration Guide
          • Host-To-Host Integration Guide
          • Mastercard Automatic Billing Updater (ABU) Integration Guide
            • Backend Integration
        • e-Wallet
          • Overview
          • DOKU e-Wallet
          • OVO Push Payment
          • ShopeePay
          • LinkAja
        • Paylater
          • Akulaku
          • Kredivo
          • Indodana
        • Digital Banking
          • Jenius Pay
        • Convenience Store
          • Alfa Group
          • Indomaret
      • SNAP
        • Integration Guide
          • Get Token API
            • B2B
            • B2B2C
          • Virtual Account
            • CIMB Virtual Account
            • BSI Virtual Account
            • BCA Virtual Account
            • BNC Virtual Account
            • BNI Virtual Account
            • Mandiri Virtual Account
            • BRI Virtual Account
            • BTN Virtual Account
            • Permata Virtual Account
            • Danamon Virtual Account
            • BSS Virtual Account
          • E-Wallet
            • DOKU Wallet
            • DANA
            • OVO
            • ShopeePay
          • Direct Debit
            • Allo Bank Direct Debit
            • BRI Direct Debit
            • CIMB Direct Debit
            • Mandiri Direct Debit
          • Kartu Kredit Indonesia Cepat Secure(KKI CPTS)
            • Host to Host Integration
          • QRIS
    • Finance and Settlement
      • Split Settlement
      • Custom Settlement Report
      • Hold and Release Settlement
      • Bulk Registration Bank
    • Test on DOKU Demo Site
    • DOKU Payment Simulator
  • Developer Kit
    • Postman Collection
    • Libraries and SDK
  • Wallet As A Service
    • Sub Account
  • Partnership
    • Partner API
      • Check Requirements API
      • Generate Token API
      • Upload File API
      • Business Registration API
      • Create Business Lite API
      • Get Business Data API
  • Payout
    • Kirim DOKU
  • FLEXIBILL
    • Account Billing
      • Batch Upload
    • DOKU Biller
      • Response Code
      • Samples
  • PAYCHAT API
    • Send WhatsApp Message
  • Archive
    • Non-SNAP
      • Tokenization V1
      • e-Wallet
        • OVO Recurring
        • OVO Open API
    • SNAP
      • Virtual Account
        • BCA v1.0
        • BRI v1.0
        • BNI v1.0
        • BNC v1.0
        • Mandiri v1.0
        • BTN v1.0
        • Permata v1.0
        • Danamon Virtual Account
      • e-Wallet
        • OVO Open API
        • DANA
        • ShopeePay
      • Direct Debit
        • CIMB Direct Debit
        • BRI Direct Debit
        • Allobank
Powered by GitBook

DOKU API

  • Legacy Documentation
On this page
  • Introduction
  • Integration
  • API Specification
  • Response
  • Rate Limits
  • Notes

Was this helpful?

  1. PAYCHAT API

Send WhatsApp Message

Introduction

WhatsApp is one of the most popular messaging applications worldwide, with over 2 billion active users. It enables real-time communication through text messages, voice calls, video calls, and multimedia sharing. Businesses use WhatsApp to engage with customers efficiently, offering services such as customer support, notifications, and marketing campaigns.

Potential Users for WhatsApp Broadcast Messages

WhatsApp broadcast messages allow businesses to send messages to multiple recipients at once. However, recipients must have saved the sender’s phone number in their contacts to receive these messages. This feature is ideal for:

  • Customer engagement and retention

  • Promotional offers and marketing campaigns

  • Appointment reminders and notifications

  • Automated customer support responses

Advantages of WhatsApp Over SMS

Compared to traditional SMS, WhatsApp provides several benefits:

  • Rich Media Support: Send images, videos, documents, and voice messages.

  • Read Receipts: Track message delivery and read status.

  • Two-Way Communication: Unlike SMS, WhatsApp supports interactive conversations.

  • End-to-End Encryption: Ensures secure messaging.

  • Cost-Effective: WhatsApp messages are sent over the internet, reducing SMS costs.


Integration

The diagram illustrates the architecture of a messaging system integrating a merchant's services with WhatsApp through DOKU Message Service and Meta's platform. Below is a detailed explanation of the components and their interactions:

  1. Merchant:

    • The merchant represents a business or service provider that needs to send messages to customers through WhatsApp.

    • It communicates with the DOKU Message Service to send messages.

  2. DOKU Message Service:

    • Acts as an intermediary between the merchant and Meta (the company behind WhatsApp).

    • Handles message processing and transmission from the merchant to WhatsApp via Meta.

    • It also allows Merchant Admin to create message templates.

  3. Merchant Admin & Web App:

    • The Merchant Admin can create message templates using a Web App.

    • The templates are likely predefined message formats required by WhatsApp for business messaging.

  4. Meta (Facebook/WhatsApp API):

    • Meta's servers act as a gateway for messages sent via WhatsApp.

    • The DOKU Message Service communicates with Meta’s API to ensure messages reach the correct recipients.

  5. WhatsApp Channel:

    • Messages processed by Meta are sent to end-users through WhatsApp.

    • Messages can be received on different platforms, including Android phones, iPhones, and Computers.

Process Flow:

  1. The Merchant sends a message request to the DOKU Message Service.

  2. The DOKU Message Service forwards the request to Meta.

  3. Meta processes the message and delivers it via WhatsApp Channel (Android, iPhone, or Computer).

  4. Meanwhile, the Merchant Admin can create or manage message templates through a Web App.

This architecture enables businesses to automate and streamline customer communication via WhatsApp, ensuring efficient and structured messaging.

API Specification

Header

Key
Remarks

Client-Id

This is a unique ID used for identification with an API.

Request-Timestamp

It refers to UTC time in epoch format (in milliseconds). Epoch time is calculated as the number of milliseconds since January 1, 1970, at 00:00:00 UTC. Example: 1672531199000.

Request-Id

It is a unique identifier used to track every request sent to the API. This identifier is useful for debugging and log tracking, especially when issues arise.

Signature

End Point

  • Method: POST

  • Content-Type: application/json

Body Request Parameters

No
Name
Type
Length
Required
Description

1

templateId

AN

10

The unique identifier for the message template being used. This ID specifies the predefined format and content of the message.

2

params

AN (Array)

-

A list of values that will be dynamically inserted into the template's placeholders. These values personalize the message content.

3

destinationPhone

N

20

The recipient's phone number, formatted as a string. This specifies where the message will be sent..

Example

{
    "templateId": "TMP-240223-07652",
    "params": [
        "value 1", "value 2", "value 3"
    ],
    "destinationPhone": "087823678023"
}

Response

Success

{
    "status": "submitted",
    "messageId": "a8f30193-1a4f-41ac-b01f-d559e2e1339f"
}

Fail

{
    "error": {
        "code": "invalid_signature",
        "message": "invalid signature",
        "type": "invalid_signature"
    }
}

Rate Limits

  • Maximum 100 requests per minute.

Notes

  • Ensure your WhatsApp Business API is properly configured.

  • Templates must be pre-approved by WhatsApp before use.

PreviousResponse CodeNextNon-SNAP

Last updated 29 days ago

Was this helpful?

Interact with the API, you need an API key. You can obtain your API key from the API page.

This is a signature generated using a secret key obtained from DOKU. It serves as proof that the request genuinely comes from the merchant and has not been altered along the way. Here is a reference for creating a signature.

url sandbox:

url Production:

For further inquiries, contact:

settings - API Keys
https://app-uat.doku.com/message-as-a-service/v1/whatsapp/messages
https://app.doku.com/message-as-a-service/v1/whatsapp/messages
billingservice@doku.com
✅
✅
✅
https://dashboard.doku.com/docs/docs/technical-references/generate-signature/
General Flow