NAV -image
bash javascript php

Introduction

IVOWBA API documentation

This documentation aims to provide all the information you need to work with our API.

Base URL

https://waba.ivosights.com

All of your outgoing requests will be processed through the API endpoint while incoming message notification (like new message notification, delivered message notification) will be delivered via WEBHOOK to your server.

Service principle:

  1. Send message through API
  2. Receive message through WEBHOOK

Authenticating requests

To authenticate requests, include a X-API-KEY header with the value "{YOUR_API_KEY}".

All authenticated endpoints are marked with a requires authentication badge in the documentation below.

You can retrieve your API KEY by visiting your dashboard at developer section.

Contact

Check Whatsapp Contact

requires authentication

Use the contacts node to manage WhatsApp users in your database by validating them before sending messages and verify a user's identity with identity hashes. a valid WhatsApp contact would have a wa_id, this wa_id will be used to send a WhatsApp Message to selected contact

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/contacts/check" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"contacts":["+628954218621","+628127631234"]}'
const url = new URL("https://waba.ivosights.com/api/v1/contacts/check");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    contacts: ["+628954218621", "+628127631234"]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/contacts/check',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'contacts' => [
                '+628954218621',
                '+628127631234',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "contacts": [
        {
            "input": "+628537639789",
            "status": "invalid"
        },
        {
            "input": "+62895421862180",
            "status": "valid",
            "wa_id": "62895421862180"
        }
    ],
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

POST api/v1/contacts/check

Body Parameters

contacts  string[]  
Array of valid phone numbers including country code prefix.

Country

Fetch Countries

requires authentication

Fetch country list including ISO code and phone dial code

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/countries" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/countries"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/countries',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "6074716f6c09086f640ee9da",
            "name": "Indonesia",
            "dial_code": "+62",
            "iso": "ID",
            "iso3": "IDN"
        },
        {
            "id": "6074716f6c09086f640ee9db",
            "name": "Iran",
            "dial_code": "+98",
            "iso": "IR",
            "iso3": "IRN"
        }
    ]
}

Request   

GET api/v1/countries

Media

Retrieve WhatsApp Media

requires authentication

Fetch Whatsapp media file like image, audio, video from incoming message

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

<Binary data> -  Media file

Example response (404, file not found):

{
    "message": "File not found"
}

Request   

GET api/v1/media/{id}

URL Parameters

id  string  
Media ID

Message Template

Fetch My Templates

requires authentication

Use this endpoint to retrieve all message templates assigned to your WhatsApp Account

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "60243665e4058d3b4a377bd2",
            "label": "New Project Setup Notification",
            "template_name": "new_project_setup_notification",
            "template_id": 408466377096510,
            "status": "approved",
            "category_id": "UTILITY",
            "language_id": "id",
            "components": [
                {
                    "type": "HEADER",
                    "format": "TEXT",
                    "text": "Notifikasi Akun {{1}}",
                    "parameters": {
                        "{{1}}": null
                    }
                },
                {
                    "type": "BODY",
                    "text": "Halo {{1}}, Terimakasih telah menggunakan layanan Kami.\nAkun WhatsApp Business Anda sudah siap untuk digunakan.\nSilahkan login ke halaman dashboard untuk informasi lebih lanjut.",
                    "parameters": {
                        "{{1}}": null
                    }
                },
                {
                    "type": "FOOTER",
                    "text": "Ivosights",
                    "parameters": []
                },
                {
                    "type": "BUTTONS",
                    "buttons": [
                        {
                            "type": "URL",
                            "text": "Website",
                            "url": "https://ivosights.com"
                        },
                        {
                            "type": "PHONE_NUMBER",
                            "text": "Bantuan",
                            "phone_number": "+622122902218"
                        }
                    ]
                }
            ],
            "histories": [],
            "created_at": "2021-05-10T05:13:23.843000Z",
            "updated_at": "2021-05-10T05:13:23.843000Z"
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": {}
        }
    }
}

Request   

GET api/v1/message-templates

Fetch All Templates

requires authentication

This endpoint is used to show all available templates related to your WhatsApp Account

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/message-templates/all-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/message-templates/all-templates"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/message-templates/all-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "60243665e4058d3b4a377bd2",
            "label": "New Project Setup Notification",
            "template_name": "new_project_setup_notification",
            "template_id": 408466377096510,
            "status": "approved",
            "category_id": "UTILITY",
            "language_id": "id",
            "components": [
                {
                    "type": "HEADER",
                    "format": "TEXT",
                    "text": "Notifikasi Akun {{1}}",
                    "parameters": {
                        "{{1}}": null
                    }
                },
                {
                    "type": "BODY",
                    "text": "Halo {{1}}, Terimakasih telah menggunakan layanan Kami.\nAkun WhatsApp Business Anda sudah siap untuk digunakan.\nSilahkan login ke halaman dashboard untuk informasi lebih lanjut.",
                    "parameters": {
                        "{{1}}": null
                    }
                },
                {
                    "type": "FOOTER",
                    "text": "Ivosights",
                    "parameters": []
                },
                {
                    "type": "BUTTONS",
                    "buttons": [
                        {
                            "type": "URL",
                            "text": "Website",
                            "url": "https://ivosights.com"
                        },
                        {
                            "type": "PHONE_NUMBER",
                            "text": "Bantuan",
                            "phone_number": "+622122902218"
                        }
                    ]
                }
            ],
            "histories": [],
            "created_at": "2021-05-10T05:13:23.843000Z",
            "updated_at": "2021-05-10T05:13:23.843000Z"
        },
        {
            "id": "60243665e4058d3b4a377bce",
            "label": "Issue Resolve",
            "template_name": "issue_resolve",
            "template_id": 3569517459822920,
            "status": "approved",
            "category_id": "ISSUE_RESOLUTION",
            "language_id": "id",
            "components": [
                {
                    "type": "BODY",
                    "text": "Permasalahan {{1}} telah terselesaikan. Jika Anda masih mengalami kendala, beri tahu kami melalui whatsapp ini. Kami senang dapat melayani Anda.",
                    "examples": [
                        "Permasalahan #21 telah terselesaikan. Jika Anda masih mengalami kendala, beri tahu kami melalui whatsapp ini. Kami senang dapat melayani Anda"
                    ],
                    "parameters": {
                        "{{1}}": null
                    }
                }
            ],
            "histories": [],
            "created_at": "2021-05-10T05:13:23.808000Z",
            "updated_at": "2021-05-10T05:13:23.808000Z"
        }
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": {}
        }
    }
}

Request   

GET api/v1/message-templates/all-templates

Create template

requires authentication

Example request (Basic):

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"New Project Setup Notification","category_id":"UTILITY","language_id":"id","is_propose":false,"header":{"format":"TEXT","text":"Notifikasi akun {{1}}","examples":["Sociomile"]},"body":{"text":"Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.","examples":["Salsabila"]},"footer":"Ivosights"}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "UTILITY",
    language_id: "id",
    is_propose: false,
    header: {
        format: "TEXT",
        text: "Notifikasi akun {{1}}",
        examples: ["Sociomile"]
    },
    body: {
        text:
            "Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.",
        examples: ["Salsabila"]
    },
    footer: "Ivosights"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            'header' => [
                'format' => 'TEXT',
                'text' => 'Notifikasi akun {{1}}',
                'examples' => ['Sociomile'],
            ],
            'body' => [
                'text' => 'Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.',
                'examples' => [
                    'Salsabila'
                ],
            ],
            'footer' => 'Ivosights'
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request (With Media Header):

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"New Project Setup Notification","category_id":"UTILITY","language_id":"id","is_propose":false,"header":{"format":"IMAGE","examples":["https://image.url"]},"body":{"text":"Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.","examples":["Salsabila"]},"footer":"Ivosights"}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "UTILITY",
    language_id: "id",
    is_propose: false,
    header: {
        format: "IMAGE",
        examples: ["https://image.url"]
    },
    body: {
        text:
            "Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.",
        examples: ["Salsabila"]
    },
    footer: "Ivosights"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            'header' => [
                'format' => 'IMAGE',
                'examples' => ["https://image.url"],
            ],
            'body' => [
                'text' => 'Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.',
                'examples' => [
                    'Salsabila'
                ],
            ],
            'footer' => 'Ivosights'
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request (With URL, Phone number buttons):

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"New Project Setup Notification","category_id":"UTILITY","language_id":"id","is_propose":false,"header":{"format":"TEXT","text":"Notifikasi akun {{1}}","examples":["Sociomile"]},"body":{"text":"Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.","examples":["Salsabila"]},"footer":"Ivosights","buttons":[{"type":"URL","text":"Klik sekarang","url":"https://test.com"},{"type":"PHONE_NUMBER","text":"Call us","country_code":"+62","phone_number":"85128567890"}]}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "UTILITY",
    language_id: "id",
    is_propose: false,
    header: {
        format: "TEXT",
        text: "Notifikasi akun {{1}}",
        examples: ["Sociomile"]
    },
    body: {
        text:
            "Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.",
        examples: ["Salsabila"]
    },
    footer: "Ivosights",
    buttons: [
        {
            type: "URL",
            text: "Klik sekarang",
            url: "https://test.com"
        },
        {
            type: "PHONE_NUMBER",
            text: "Call us",
            country_code: "+62",
            phone_number: "85128567890"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            'header' => [
                'format' => 'TEXT',
                'text' => 'Notifikasi akun {{1}}',
                'examples' => ['Sociomile'],
            ],
            'body' => [
                'text' => 'Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.',
                'examples' => [
                    'Salsabila'
                ],
            ],
            'footer' => 'Ivosights',
            'buttons' => [
                [
                    "type" => "URL",
                    "text" => "Klik sekarang",
                    "url" => "https://test.com",
                ],
                [
                    "type" => "PHONE_NUMBER",
                    "text" => "Call us",
                    "country_code" => "+62",
                    "phone_number" => "85128567890"
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request (With dynamic URL):

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"New Project Setup Notification","category_id":"UTILITY","language_id":"id","is_propose":false,"header":{"format":"TEXT","text":"Notifikasi akun {{1}}","examples":["Sociomile"]},"body":{"text":"Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.","examples":["Salsabila"]},"footer":"Ivosights","buttons":[{"type":"URL","text":"Klik sekarang","url_type":"dynamic","url":"https://test.com/{{1}}","examples":["john-doe"]},{"type":"PHONE_NUMBER","text":"Call us","country_code":"+62","phone_number":"85128567890"}]}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "UTILITY",
    language_id: "id",
    is_propose: false,
    header: {
        format: "TEXT",
        text: "Notifikasi akun {{1}}",
        examples: ["Sociomile"]
    },
    body: {
        text:
            "Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.",
        examples: ["Salsabila"]
    },
    footer: "Ivosights",
    buttons: [
        {
            type: "URL",
            text: "Klik sekarang",
            url_type: "dynamic",
            url: "https://test.com/{{1}}",
            examples: ["john-doe"]
        },
        {
            type: "PHONE_NUMBER",
            text: "Call us",
            country_code: "+62",
            phone_number: "85128567890"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            'header' => [
                'format' => 'TEXT',
                'text' => 'Notifikasi akun {{1}}',
                'examples' => ['Sociomile'],
            ],
            'body' => [
                'text' => 'Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.',
                'examples' => [
                    'Salsabila'
                ],
            ],
            'footer' => 'Ivosights',
            'buttons' => [
                [
                    "type" => "URL",
                    "text" => "Klik sekarang",
                    "url_type" => "dynamic",
                    "url" => "https://test.com/{{1}}",
                    "example" => ["john-doe"]
                ],
                [
                    "type" => "PHONE_NUMBER",
                    "text" => "Call us",
                    "country_code" => "+62",
                    "phone_number" => "85128567890"
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request (One Time Password/ OTP):

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"One Time Password Template","category_id":"AUTHENTICATION","language_id":"id","is_propose":false,"otp":[{"otp_type":"COPY_CODE","text":"Salin Kode"}],"add_security_recommendation":true,"code_expiration_minutes": 30}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "AUTHENTICATION",
    language_id: "id",
    is_propose: false,
    otp: [{ otp_type: "COPY_CODE", text: "Salin Kode" }],
    add_security_recommendation: true,
    code_expiration_minutes: 30
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            "otp" => [
                [
                    "otp_type" => "COPY_CODE",
                    "text" => "Salin Kode"
                ]
            ],
            "add_security_recommendation" => true,
            "code_expiration_minutes" => 30
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request   

POST api/v1/message-templates

Body Parameters

label  string  
Template label, it's template name. make a descriptif label based on message content.

category_id  string  
A message tempate should belongs to a right category. The value must be one of UTILITY, MARKETING, AUTHENTICATION.

language_id  string  
ISO code for template language. The value must be one of af, sq, ar, az, bn, bg, ca, zh_CN, zh_HK, zh_TW, hr, cs, da, nl, en, en_GB, en_US, et, fil, fi, fr, de, el, gu, ha, he, hi, hu, id, ga, it, ja, kn, kk, ko, lo, lv, lt, mk, ms, ml, mr, nb, fa, pl, pt_BR, pt_PT, pa, ro, ru, sr, sk, sl, es, es_AR, es_ES, es_MX, sw, sv, ta, te, th, tr, uk, ur, uz, vi, or zu.

is_propose  boolean optional  
Propose means your template will be proposed to Ivosights team for approval before submitted to WhatsApp. default: false.

header  object optional  
Message header

header.format  string optional  
Accepted header format: text, video, image, or document. The value must be one of TEXT, DOCUMENT, IMAGE, or VIDEO.

header.text  string optional  
Header content.

header.examples  string optional  
Header examples. This parameter is required if header.format is text and contains a variable.

body  object optional  
Message body

body.text  string  
Message body is where you put your message context.

body.examples  string[] optional  
Body examples.

footer  string optional  
Footer is used when you need to add additional text at the bottom of your message template.

buttons  object[] optional  
Additional action buttons

buttons[].type  string optional  
Button Type. The value must be one of PHONE_NUMBER, URL, or QUICK_REPLY.

buttons[].text  string optional  
Button label.

buttons[].phone_number  string optional  
This parameter is required if buttons.type is PHONE_NUMBER.

buttons[].url_type  string optional  
This parameter is required if buttons.type is URL. Accepted values: static or dynamic

buttons[].url  string optional  
This parameter is required if buttons.type is URL.

buttons[].examples  string[] optional  
This parameter is required if buttons.type is URL, and buttons.url_type is dynamic

otp  object[] optional  
Required if category_id is AUTHENTICATION.
Specify the OTP button

buttons[].type  string required  
Button Type. It should be OTP

buttons[].otp_type  string required  
Button Type. The value must be one of COPY_CODE, or ONE_TAP.

buttons[].text  string required  
Button text.

buttons[].autofill_text  string optional  
This parameter is required if buttons.otp_type is ONE_TAP.

buttons[].package_name  string optional  
This parameter is required if buttons.otp_type is ONE_TAP.

buttons[].signature_hash  string optional  
This parameter is required if buttons.otp_type is ONE_TAP.

add_security_recommendation  boolean optional  
Required if category_id is AUTHENTICATION
Set to true if you want the template to include the string, For your security, do not share this code. Set to false to exclude the string.

code_expiration_minutes  integer optional  
Required if category_id is AUTHENTICATION
Indicates number of minutes the password or code is valid. If omitted, the code expiration warning will not be displayed in the delivered message.
Minimum 1, maximum 90.

Show template

requires authentication

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/message-templates/60243665e4058d3b4a377bd2" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/message-templates/60243665e4058d3b4a377bd2"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/message-templates/60243665e4058d3b4a377bd2',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "id": "60243665e4058d3b4a377bd2",
    "label": "New Project Setup Notification",
    "template_name": "new_project_setup_notification",
    "template_id": 408466377096510,
    "status": "approved",
    "category_id": "UTILITY",
    "language_id": "id",
    "components": [
        {
            "type": "HEADER",
            "format": "TEXT",
            "text": "Notifikasi Akun {{1}}",
            "parameters": {
                "{{1}}": null
            }
        },
        {
            "type": "BODY",
            "text": "Halo {{1}}, Terimakasih telah menggunakan layanan Kami.\nAkun WhatsApp Business Anda sudah siap untuk digunakan.\nSilahkan login ke halaman dashboard untuk informasi lebih lanjut.",
            "parameters": {
                "{{1}}": null
            }
        },
        {
            "type": "FOOTER",
            "text": "Ivosights",
            "parameters": []
        },
        {
            "type": "BUTTONS",
            "buttons": [
                {
                    "type": "URL",
                    "text": "Website",
                    "url": "https://ivosights.com"
                },
                {
                    "type": "PHONE_NUMBER",
                    "text": "Bantuan",
                    "phone_number": "+622122902218"
                }
            ]
        }
    ],
    "histories": [],
    "created_at": "2021-05-10T05:13:23.843000Z",
    "updated_at": "2021-05-10T05:13:23.843000Z"
}

Request   

GET api/v1/message-templates/{id}

URL Parameters

id  string  
Template ID

Update template

requires authentication

Example request:

curl -X PUT \
    "https://waba.ivosights.com/api/v1/message-templates/aut" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"label":"New Project Setup Notification","category_id":"UTILITY","language_id":"id","is_propose":false,"header":{"format":"TEXT","text":"Notifikasi akun {{1}}","examples":["Sociomile"]},"body":{"text":"Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.","examples":["Salsabila","Aqilah"]},"footer":"Ivosights","buttons":[{"type":"URL","text":"Website","phone_number":"+622122902218","url":"https:\/\/ivosights.com\/","example":["dolore","illum"]}]}'
const url = new URL("https://waba.ivosights.com/api/v1/message-templates/aut");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    label: "New Project Setup Notification",
    category_id: "UTILITY",
    language_id: "id",
    is_propose: false,
    header: {
        format: "TEXT",
        text: "Notifikasi akun {{1}}",
        examples: ["Sociomile"]
    },
    body: {
        text:
            "Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.",
        examples: ["Salsabila", "Aqilah"]
    },
    footer: "Ivosights",
    buttons: [
        {
            type: "URL",
            text: "Website",
            phone_number: "+622122902218",
            url: "https://ivosights.com/",
            example: ["dolore", "illum"]
        }
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://waba.ivosights.com/api/v1/message-templates/aut',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'label' => 'New Project Setup Notification',
            'category_id' => 'UTILITY',
            'language_id' => 'id',
            'is_propose' => false,
            'header' => [
                'format' => 'TEXT',
                'text' => 'Notifikasi akun {{1}}',
                'examples' => [
                    'Sociomile',
                ],
            ],
            'body' => [
                'text' => 'Halo {{1}}, Terimakasih telah menggunakan layanan Kami. Akun WhatsApp Business Anda sudah siap untuk digunakan. Silahkan login ke halaman dashboard untuk informasi lebih lanjut.',
                'examples' => [
                    'Salsabila',
                    'Aqilah',
                ],
            ],
            'footer' => 'Ivosights',
            'buttons' => [
                [
                    'type' => 'URL',
                    'text' => 'Website',
                    'phone_number' => '+622122902218',
                    'url' => 'https://ivosights.com/',
                    'example' => [
                        'dolore',
                        'illum',
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request   

PUT api/v1/message-templates/{id}

URL Parameters

id  string  

Body Parameters

label  string  
Template label, it's template name. make a descriptif label based on message content.

category_id  string  
A message tempate should belongs to a right category. The value must be one of UTILITY, MARKETING, AUTHENTICATION.

language_id  string  
ISO code for template language. The value must be one of af, sq, ar, az, bn, bg, ca, zh_CN, zh_HK, zh_TW, hr, cs, da, nl, en, en_GB, en_US, et, fil, fi, fr, de, el, gu, ha, he, hi, hu, id, ga, it, ja, kn, kk, ko, lo, lv, lt, mk, ms, ml, mr, nb, fa, pl, pt_BR, pt_PT, pa, ro, ru, sr, sk, sl, es, es_AR, es_ES, es_MX, sw, sv, ta, te, th, tr, uk, ur, uz, vi, or zu.

is_propose  boolean optional  
Propose means your template will be proposed to Ivosights team for approval before submitted to WhatsApp. default: false.

header  object optional  

header.format  string optional  
Accepted header format: text, video, image, or document. The value must be one of TEXT, DOCUMENT, IMAGE, or VIDEO.

header.text  string optional  
Header content.

header.examples  string[] optional  
Header examples.

body  object optional  

body.text  string  
Message body is where you put your message context.

body.examples  string[] optional  
Body examples.

footer  string optional  
Footer is used when you need to add additional text at the bottom of your message template.

buttons  object[] optional  

buttons[].type  string optional  
Button Type. The value must be one of PHONE_NUMBER, URL, or QUICK_REPLY.

buttons[].text  string optional  
Button label.

buttons[].phone_number  string optional  
This parameter is required if buttons.type is PHONE_NUMBER.

buttons[].url  string optional  
This parameter is required if buttons.type is URL.

buttons[].example  string[] optional  

Propose template

requires authentication

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/message-templates/iusto/propose" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/message-templates/iusto/propose"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "POST",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/message-templates/iusto/propose',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request   

POST api/v1/message-templates/{id}/propose

URL Parameters

id  string  

Template category

requires authentication

Fetch WhatsApp Message Template Categories

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/template-categories" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL("https://waba.ivosights.com/api/v1/template-categories");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/template-categories',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "UTILITY",
            "name": "Transactional"
        },
        {
            "id": "MARKETING",
            "name": "Marketing"
        },
        {
            "id": "AUTHENTICATION",
            "name": "Authentication"
        }
    ]
}

Request   

GET api/v1/template-categories

Template Language

requires authentication

Fetch all supported languages for handling WhatsApp message template

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/template-languages" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL("https://waba.ivosights.com/api/v1/template-languages");

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/template-languages',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "id",
            "name": "Indonesian"
        },
        {
            "id": "ga",
            "name": "Irish"
        },
        {
            "id": "it",
            "name": "Italian"
        }
    ]
}

Request   

GET api/v1/template-languages

Message

Send contact message

requires authentication

Send WhatsApp contact

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-contact-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","contacts":[{"addresses":[{"city":"Menlo Park","country":"United States","country_code":"us","state":"CA","street":"1 Hacker Way","type":"HOME","zip":"94025"}],"birthday":"1990-08-18","emails":[{"email":"[email protected]","type":"WORK"}],"name":{"formatted_name":"John Doe"},"org":{"company":"Ivosight","department":"IT","title":"Manager"},"phones":[{"phone":"+1 (940) 555-1234","type":"HOME"}],"urls":[{"url":"https://ivosights.com/","type":"WORK"}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-contact-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    contacts: [
        {
            addresses: [
                {
                    city: "Menlo Park",
                    country: "United States",
                    country_code: "us",
                    state: "CA",
                    street: "1 Hacker Way",
                    type: "HOME",
                    zip: "94025"
                }
            ],
            birthday: "1990-08-18",
            emails: [
                {
                    email: "[email protected]",
                    type: "WORK"
                }
            ],
            name: {
                formatted_name: "John Doe"
            },
            org: {
                company: "Ivosight",
                department: "IT",
                title: "Manager"
            },
            phones: [
                {
                    phone: "+1 (940) 555-1234",
                    type: "HOME"
                }
            ],
            urls: [
                {
                    url: "https://ivosights.com/",
                    type: "WORK"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-contact-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'contacts' => [
                [
                    'addresses' => [
                        [
                            'city' => 'Menlo Park',
                            'country' => 'United States',
                            'country_code' => 'us',
                            'state' => 'CA',
                            'street' => '1 Hacker Way',
                            'type' => 'HOME',
                            'zip' => '94025',
                        ],
                    ],
                    'birthday' => '1990-08-18',
                    'emails' => [
                        [
                            'email' => '[email protected]',
                            'type' => 'WORK',
                        ],
                    ],
                    'name' => [
                        'formatted_name' => 'John Doe'
                    ],
                    'org' => [
                        'company' => 'Ivosight',
                        'department' => 'IT',
                        'title' => 'Manager',
                    ],
                    'phones' => [
                        [
                            'phone' => '+1 (940) 555-1234',
                            'type' => 'HOME',
                        ],
                    ],
                    'urls' => [
                        [
                            'url' => 'https://ivosights.com/',
                            'type' => 'WORK',
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-contact-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

contacts  object[] optional  

contacts[].addresses  string[] optional  

contacts[].name  object optional  

contacts[].name.formatted_name  string  

contacts[].birthday  string optional  

contacts[].emails  string[] optional  

contacts[].org  string[] optional  

contacts[].phones  string[] optional  

contacts[].urls  string[] optional  

Send location message

requires authentication

Share static location by GPS coordinate

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-location-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","latitude":37.758056,"longitude":-122.425332,"name":"Facebook","address":"1 Hacker Way, Menlo Park, CA 94025"}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-location-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    latitude: 37.758056,
    longitude: -122.425332,
    name: "Facebook",
    address: "1 Hacker Way, Menlo Park, CA 94025"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-location-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'latitude' => 37.758056,
            'longitude' => -122.425332,
            'name' => 'Facebook',
            'address' => '1 Hacker Way, Menlo Park, CA 94025',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-location-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

latitude  number  
Latitude of GPS coordinates.

longitude  number  
Longitute of GPS coordinates.

name  string optional  
Location name.

address  string optional  
Location address.

Send media message

requires authentication

Send a media message including audio, document, image, sticker, and video.

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-media-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","type":"image","link":"https:\/\/www.google.com\/images\/branding\/googlelogo\/2x\/googlelogo_color_92x30dp.png"}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-media-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    type: "image",
    link:
        "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-media-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'type' => 'image',
            'link' => 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-media-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

type  string  
Message type. The value must be one of audio, contact, document, image, location, sticker, or video.

link  string  
Public URL of your media file. The value must be a valid URL.

Send template message

requires authentication

in order to send a template message, you have to propose a template first depends on your business needed.

Example request: Only body component (no parameters)

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"635a31939245d054dd2c7ad6","components":[{"type":"body"}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            'components' => [
                [
                    'type' => 'body'
                ]
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: With Header & Body components (containt parameters)

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"60243665e4058d3b4a377bd2","components":[{"type":"body","parameters":[{"type":"text","text":"Agus Santoso"}]},{"type":"header","parameters":[{"type":"text","text":"PT. IVOSIGHTS"}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body",
            parameters: [
                {
                    type: "text",
                    text: "Agus Santoso"
                }
            ]
        },
        {
            type: "header",
            parameters: [
                {
                    type: "text",
                    text: "PT. IVOSIGHTS"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            'components' => [
                [
                    'type' => 'body',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'Agus Santoso',
                        ],
                    ],
                ],
                [
                    'type' => 'header',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'PT. IVOSIGHTS',
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: With Media header (Image)

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"60243665e4058d3b4a377bd2","components":[{"type":"body","parameters":[{"type":"text","text":"Agus Santoso"}]},{"type":"header","parameters":[{"type":"image","image":{"link":"https:\/\/www.google.com\/images\/branding\/googlelogo\/2x\/googlelogo_color_92x30dp.png"}}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body",
            parameters: [
                {
                    type: "text",
                    text: "Agus Santoso"
                }
            ]
        },
        {
            type: "header",
            parameters: [
                {
                    type: "image",
                    image: {
                        link:
                            "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"
                    }
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            'components' => [
                [
                    'type' => 'body',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'Agus Santoso',
                        ],
                    ],
                ],
                [
                    'type' => 'header',
                    'parameters' => [
                        [
                            'type' => 'image',
                            'image' => [
                                "link" => "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"
                            ]
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: With Media header (Document)

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"60243665e4058d3b4a377bd2","components":[{"type":"body","parameters":[{"type":"text","text":"Agus Santoso"}]},{"type":"header","parameters":[{"type":"document","document":{"link":"https:\/\/ivosights.com\/assets\/collections\/insights\/674486569820220714020526.pdf","filename":"Display file name"}}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body",
            parameters: [
                {
                    type: "text",
                    text: "Agus Santoso"
                }
            ]
        },
        {
            type: "header",
            parameters: [
                {
                    type: "document",
                    document: {
                        link:
                            "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png",
                        filename: "Display file name"
                    }
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            'components' => [
                [
                    'type' => 'body',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'Agus Santoso',
                        ],
                    ],
                ],
                [
                    'type' => 'header',
                    'parameters' => [
                        [
                            'type' => 'document',
                            'document' => [
                                "link" => "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png",
                                "filename" => "Display file name"
                            ]
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: With Button component

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"60243665e4058d3b4a377bd2","components":[{"type":"body","parameters":[{"type":"text","text":"Agus Santoso"}]},{"type":"button","index":"0","sub_type":"url","parameters":[{"type":"text","text":"test"}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body",
            parameters: [
                {
                    type: "text",
                    text: "Agus Santoso"
                }
            ]
        },
        {
            type: "header",
            parameters: [
                {
                    type: "text",
                    text: "PT. IVOSIGHTS"
                }
            ]
        },
        {
            type: "button",
            index: "0",
            sub_type: "url",
            parameters: [
                {
                    type: "text",
                    text: "test"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            'components' => [
                [
                    'type' => 'body',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'Agus Santoso',
                        ],
                    ],
                ],
                [
                    'type' => 'header',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'PT. IVOSIGHTS',
                        ],
                    ],
                ],
                [
                    'type' => 'button',
                    'index' => '0',
                    'sub_type' => 'url',
                    'parameters' => [
                        [
                            'type' => 'text',
                            'text' => 'test',
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: With flow

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"6639e8bb1a7e0b7fb3365514","components":[{"type":"button","index":0,"sub_type":"flow","parameters":[{"type":"action","action":{"flow_token":"426c0a609e863870882d509ca3bcae959a5bc41d"}}]}]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
  wa_id: "628123456789",
  template_id: "6639e8bb1a7e0b7fb3365514",
  components: [
    {
      type: "button",
      index: 0,
      sub_type: "flow",
      parameters: [
        {
          type: "action",
          action: {
            flow_token: "426c0a609e863870882d509ca3bcae959a5bc41d"
          }
        }
      ]
    }
  ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
        "wa_id" => "628123456789", 
        "template_id" => "6639e8bb1a7e0b7fb3365514", 
        "components" => [
                [
                    "type" => "button", 
                    "index" => 0, 
                    "sub_type" => "flow", 
                    "parameters" => [
                        [
                            "type" => "action", 
                            "action" => [
                                "flow_token" => "426c0a609e863870882d509ca3bcae959a5bc41d" 
                            ] 
                        ] 
                    ] 
                ] 
            ] 
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example request: One Time Password (OTP)

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-template-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","template_id":"635a31939245d054dd2c7ad6",{"components":[{"type":"body","parameters":[{"type":"text","text":"765987"}]},{"type":"button","sub_type":"url","index":0,"parameters":[{"type":"text","text":"765987"}]}]}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-template-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    template_id: "60243665e4058d3b4a377bd2",
    components: [
        {
            type: "body",
            parameters: [{ type: "text", text: "765987" }]
        },
        {
            type: "button",
            sub_type: "url",
            index: 0,
            parameters: [{ type: "text", text: "765987" }]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-template-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'template_id' => '60243665e4058d3b4a377bd2',
            "components" => [
                [
                    "type" => "body",
                    "parameters" => [
                        [
                            "type" => "text",
                            "text" => "765987"
                        ]
                    ]
                ],
                [
                    "type" => "button",
                    "sub_type" => "url",
                    "index" => 0,
                    "parameters" => [
                        [
                            "type" => "text",
                            "text" => "765987"
                        ]
                    ]
                ]
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-template-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

template_id  string  
Message Template Id.

components  string[]  
Message Components like header, body and footer depends on your template component.

Send text message

requires authentication

Send a common text message

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-text-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","text":"hello"}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-text-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    text: "hello"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-text-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'text' => 'hello',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-text-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

text  string  
Message content (max 4096 characters).

Send reply button message

requires authentication

Interactive message in reply button format

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-reply-button-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","header":{"type":"image","link":"https:\/\/www.google.com\/images\/branding\/googlelogo\/2x\/googlelogo_color_92x30dp.png"},"body":"PT. Ivonesia Solusi Data Understand, engage, and delight your customers with our award-winning platforms. Want to know more?","footer":"Ivosigths","action":{"buttons":[{"id":"yes","title":"Yes"}]}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-reply-button-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    header: {
        type: "image",
        link:
            "https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png"
    },
    body:
        "PT. Ivonesia Solusi Data Understand, engage, and delight your customers with our award-winning platforms. Want to know more?",
    footer: "Ivosigths",
    action: {
        buttons: [
            {
                id: "yes",
                title: "Yes"
            }
        ]
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-reply-button-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'header' => [
                'type' => 'image',
                'link' => 'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_92x30dp.png',
            ],
            'body' => 'PT. Ivonesia Solusi Data Understand, engage, and delight your customers with our award-winning platforms. Want to know more?',
            'footer' => 'Ivosigths',
            'action' => [
                'buttons' => [
                    [
                        'id' => 'yes',
                        'title' => 'Yes',
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-reply-button-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

header  object optional  

header.type  string optional  
Header Type The value must be one of text, video, image, or document.

header.text  Field optional  
is required when the header.type is text.

header.link  string optional  
Media URL.

header.filename  Field optional  
is optional, can be used to give a filename when header.type is a document.

body  string  
Message body.

footer  string optional  
Message footer.

action  object optional  

action.buttons  object[] optional  

action.buttons[].id  string optional  
Button id.

action.buttons[].title  string optional  
Button title.

Send list message

requires authentication

Interactive message in list format

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-list-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","header":{"type": "text","text":"Pesan Interaktif"},"body":"Halo... Silahkan pilih platform layanan kami yang ingin anda ketahui lebih lanjut dengan cara menekan tombol dibawah ini.","footer":"PT. Ivonesia Solusi Data","action":{"button":"Pilih Platform","sections":[{"title":"Silahkan pilih","rows":[{"id":"sociomile","title":"Sociomile","description":"Omni channel Ticketing Platform"}]}]}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-list-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    header: {
        type: "text",
        text: "Pesan Interaktif"
    },
    body:
        "Halo... Silahkan pilih platform layanan kami yang ingin anda ketahui lebih lanjut dengan cara menekan tombol dibawah ini.",
    footer: "PT. Ivonesia Solusi Data",
    action: {
        button: "Pilih Platform",
        sections: [
            {
                title: "Silahkan pilih",
                rows: [
                    {
                        id: "sociomile",
                        title: "Sociomile",
                        description: "Omni channel Ticketing Platform"
                    }
                ]
            }
        ]
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-list-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'header' => [
                'type' => 'text',
                'text' => 'Pesan Interaktif',
            ],
            'body' => 'Halo... Silahkan pilih platform layanan kami yang ingin anda ketahui lebih lanjut dengan cara menekan tombol dibawah ini.',
            'footer' => 'PT. Ivonesia Solusi Data',
            'action' => [
                'button' => 'Pilih Platform',
                'sections' => [
                    [
                        'title' => 'Silahkan pilih',
                        'rows' => [
                            [
                                'id' => 'sociomile',
                                'title' => 'Sociomile',
                                'description' => 'Omni channel Ticketing Platform',
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-list-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

header  object optional  

header.text  string optional  
Header text.

body  string  
Message body.

footer  string optional  
Message body.

action  object optional  

action.button  string  
action button title.

action.sections  object[] optional  

action.sections[].title  string optional  
Section title.

action.sections[].rows  object[] optional  

action.sections[].rows[].id  string optional  
Section ID.

action.sections[].rows[].title  string optional  
Section title.

action.sections[].rows[].description  string optional  
Section description.

Send single product message

requires authentication

Interactive message to send a single product

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-single-product-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789", "body":"Silahkan lihat detail produk kami.","footer":"PT. Ivonesia Solusi Data","action":{"catalog_id":"1234567890","product_retailer_id": "abcd12345"}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-single-product-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    body: "Silahkan lihat detail produk kami.",
    footer: "PT. Ivonesia Solusi Data",
    action: {
        catalog_id: "1234567890",
        product_retailer_id: "abcd12345"
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-single-product-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            "wa_id" => "628123456789",
            "body" => "Silahkan lihat detail produk kami.",
            "footer" => "PT. Ivonesia Solusi Data",
            "action" => [
                "catalog_id" => "1234567890",
                "product_retailer_id" => "abcd12345"
            ]
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-single-product-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

body  string optional  
Message body.

footer  string optional  
Message footer.

action  object  

action.catalog_id  string  
action catalog_id.

action.product_retailer_id  string  

Send Multi product message

requires authentication

Interactive message to send multi products

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-multi-product-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","header":"New Product","body":"Silahkan pilih produk kami yang sedang trend saat ini.","footer":"PT. Ivonesia Solusi Data","action":{"catalog_id":"1234567890","sections":[{"title":"New Product","product_items":[{"product_retailer_id":"abc12345"},{"product_retailer_id":"abc4567"}]}]}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-multi-product-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    header: "New Product",
    body: "Silahkan pilih produk kami yang sedang trend saat ini.",
    footer: "PT. Ivonesia Solusi Data",
    action: {
        catalog_id: "1234567890",
        sections: [
            {
                title: "New Product",
                product_items: [
                    { product_retailer_id: "abc12345" },
                    { product_retailer_id: "abc4567" }
                ]
            }
        ]
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-multi-product-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            "wa_id" => "628123456789",
            "header" => "New Product",
            "body" => "Silahkan pilih produk kami yang sedang trend saat ini.",
            "footer" => "PT. Ivonesia Solusi Data",
            "action" => [
                "catalog_id" => "1234567890",
                "sections" => [
                    [
                    "title" => "New Product",
                    "product_items" => [
                        [
                            "product_retailer_id" => "abc12345"
                        ],
                        [
                            "product_retailer_id" => "abc4567"
                        ]
                    ]
                    ]
                ]
            ]
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-multi-product-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

header  object  

body  string  
Message body.

footer  string optional  
Message footer.

action  object  

action.catalog_id  string  
action catalog_id.

action.sections  object[] optional  

action.sections[].title  string optional  
Section title.

action.sections[].product_items  object[] optional  

action.sections[].product_items[].product_retailer_id  string optional  
Section product_retailer_id.

Send Flow message

requires authentication

Interactive message in flow format

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/messages/send-flow-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","header":{"type":"text","text":"Header text"},"body":"Body text of the flow","footer":"Footer text of the flow","action":{"parameters":{"flow_message_version":"3","flow_id":"1180378639999979","flow_cta":"Register","flow_action":"navigate","flow_action_payload":{"screen":"WELCOME_SCREEN"}}}}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/send-flow-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
  wa_id: "628123456789",
  header: {
    type: "text",
    text: "Header text"
  },
  body: "Body text of the flow",
  footer: "Footer text of the flow",
  action: {
    parameters: {
      flow_message_version: "3",
      flow_id: "1180378639999979",
      flow_cta: "Register",
      flow_action: "navigate",
      flow_action_payload: {
        screen: "WELCOME_SCREEN"
      }
    }
  }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/messages/send-flow-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
        "wa_id" => "628123456789", 
        "header" => [
                "type" => "text", 
                "text" => "Header text" 
            ], 
        "body" => "Body text of the flow", 
        "footer" => "Footer text of the flow", 
        "action" => [
                    "parameters" => [
                    "flow_message_version" => "3", 
                    "flow_id" => "1180378639999979", 
                    "flow_cta" => "Register", 
                    "flow_action" => "navigate", 
                    "flow_action_payload" => [
                        "screen" => "WELCOME_SCREEN" 
                    ] 
                ] 
            ] 
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST api/v1/messages/send-flow-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

header  object  

body  string  
Message body.

footer  string optional  
Message footer.

action  object  

action.parameters  object  

action.parameters.flow_message_version  string  
Flow message version. The value should be 3

action.parameters.flow_id  string  
ID of the flow 3

action.parameters.flow_cta  string  
Flow call to action's text

action.parameters.flow_action  string  
Flow action. The value should be navigate

action.parameters.flow_action_payload  object  
Flow action payload.

Mark Message as Read

requires authentication

Mark a received message within a conversation as read

Example request:

curl -X PUT \
    "https://waba.ivosights.com/api/v1/messages/gBEGkYiEB1VXAglK1ZEqA1YKPrU/read" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/messages/gBEGkYiEB1VXAglK1ZEqA1YKPrU/read"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "PUT",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->put(
    'https://waba.ivosights.com/api/v1/messages/gBEGkYiEB1VXAglK1ZEqA1YKPrU/read',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

null

Request   

PUT api/v1/messages/{messageId}/read

URL Parameters

messageId  string optional  
Message ID is obtained from the response body after sending a message.

Setting

WhatsApp business profile

requires authentication

Fetch WhatsApp profile info such as business address, business description etc.

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/settings/business-profile" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/business-profile"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/settings/business-profile',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "settings": {
        "business": {
            "profile": {
                "address": "Jl. Tebet Barat I No.2, RT.1\/RW.2, Tebet Bar., Kec. Tebet, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12810",
                "description": "A Series of Platforms to Engage Your Customers",
                "email": "[email protected]",
                "vertical": "Professional Services",
                "websites": [
                    "https:\/\/ivosigths.com"
                ]
            }
        }
    },
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

GET api/v1/settings/business-profile

Update WhatsApp business profile

requires authentication

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/settings/business-profile" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"address":"Jl. Tebet Barat I No.2, RT.1\\\/RW.2, Tebet Bar., Kec. Tebet, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12810","description":"A Series of Platforms to Engage Your Customers","email":"[email protected]","vertical":"Professional Services","websites":["https:\/\/www.ivosigths.com"]}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/business-profile"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "address": "Jl. Tebet Barat I No.2, RT.1\\\/RW.2, Tebet Bar., Kec. Tebet, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12810",
    "description": "A Series of Platforms to Engage Your Customers",
    "email": "[email protected]",
    "vertical": "Professional Services",
    "websites": [
        "https:\/\/www.ivosigths.com"
    ]
}

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/settings/business-profile',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'address' => 'Jl. Tebet Barat I No.2, RT.1\\/RW.2, Tebet Bar., Kec. Tebet, Kota Jakarta Selatan, Daerah Khusus Ibukota Jakarta 12810',
            'description' => 'A Series of Platforms to Engage Your Customers',
            'email' => '[email protected]',
            'vertical' => 'Professional Services',
            'websites' => [
                'https://www.ivosigths.com',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

POST api/v1/settings/business-profile

Body Parameters

address  string optional  
Business address.

description  string optional  
Short description about your business.

email  string optional  
Official email address The value must be a valid email address.

vertical  string  
Business category. The value must be one of Automotive, Beauty, Spa and Salon, Clothing and Apparel, Education, Entertainment, Event Planning and Service, Finance and Banking, Food and Grocery, Public Service, Hotel and Lodging, Medical and Health, Non-profit, Professional Services, Shopping and Retail, Travel and Transportation, Restaurant, or Other.

websites  string[] optional  
URL The value must be a valid URL.

WhatsApp profile about text

requires authentication

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/settings/profiles/about" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/profiles/about"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/settings/profiles/about',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "settings": {
        "profile": {
            "about": {
                "text": "Halo Dunia.."
            }
        }
    },
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

GET api/v1/settings/profiles/about

Update WhatsApp profile about text

requires authentication

Example request:

curl -X PATCH \
    "https://waba.ivosights.com/api/v1/settings/profiles/about" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"text":"Hello.. we are using WhatsApp Business Account"}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/profiles/about"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "text": "Hello.. we are using WhatsApp Business Account"
}

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->patch(
    'https://waba.ivosights.com/api/v1/settings/profiles/about',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'text' => 'Hello.. we are using WhatsApp Business Account',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

PATCH api/v1/settings/profiles/about

Body Parameters

text  string  
Text content / status message.

Get WhatsApp profile photo

requires authentication

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/settings/profiles/photo" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"format":"link"}'
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/profiles/photo"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "format": "link"
}

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/settings/profiles/photo',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'format' => 'link',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "settings": {
        "profile": {
            "photo": {
                "link": "https:\/\/pps.whatsapp.net\/v\/t61.24694-24\/s96x96\/139790548_239531290984431_572068075107398585_n.jpg?ccb=11-4&oh=78a0cdfaf9c1ec35d6cc8c6c6e5628eb&oe=609A20F5"
            }
        }
    },
    "meta": {
        "api_status": "stable",
        "version": "2.33.3"
    }
}

Request   

GET api/v1/settings/profiles/photo

Body Parameters

format  string optional  

Update WhatsApp profile photo

requires authentication

Example request:

curl -X POST \
    "https://waba.ivosights.com/api/v1/settings/profiles/photo" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: multipart/form-data" \
    -H "Accept: application/json" \
    -F "photo=@/tmp/phpOmKMBO" 
const url = new URL(
    "https://waba.ivosights.com/api/v1/settings/profiles/photo"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('photo', document.querySelector('input[name="photo"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/api/v1/settings/profiles/photo',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'multipart' => [
            [
                'name' => 'photo',
                'contents' => fopen('/tmp/phpOmKMBO', 'r')
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request   

POST api/v1/settings/profiles/photo

Body Parameters

photo  file  
WhatsApp profile picture. with max fize up to: 5Mb. The value must be a file.

Webhook

Fetch webhook endpoint

requires authentication

Fetch all your webhooks endpoint

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/webhooks" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/webhooks"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/webhooks',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "data": [
        {
            "id": "6098c0f34dae5677e2636a5c",
            "name": "App Webhook",
            "url": "http:\/\/webhook.me\/ea2f63e6-7583-4b82-9fa6-1bba131e6d93",
            "events": [],
            "headers": [],
            "status": "off",
            "http_auth": {
                "status": "on",
                "username": "user",
                "password": "password"
            }
        }
    ]
}

Request   

GET api/v1/webhooks

Pull pending notification

requires authentication

webhook delivery is marking as delivered to your endpoing when we get HTTP response code 200 or 201, otherwise we mark it as failed.

Normally we will try to deliver webhook notification to your endpoint in 3 times. after 3 failed attempts, we will mark a notification as failed. in this case, you should pull it manually to get all pending/failed notifitions.

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/api/v1/webhooks/60243665e4058d3b4a377bd2/pull-pending-notifications" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/api/v1/webhooks/60243665e4058d3b4a377bd2/pull-pending-notifications"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/api/v1/webhooks/60243665e4058d3b4a377bd2/pull-pending-notifications',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Request   

GET api/v1/webhooks/{webhookId}/pull-pending-notifications

URL Parameters

webhookId  string  
Webhook ID

Inbound Message Notifications

This section shows examples of received messages (delivered via webhook to your server endpoint).

Text Message Received

The following is an example of a text message received from a customer.

{
  "contacts": [ {
    "profile": {
        "name": "Kerry Fisher"
    },
    "wa_id": "16315551234"
  } ],
  "messages":[{
    "from": "16315551234",
    "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
    "timestamp": "1518694235",
    "text": {
      "body": "Hello this is an answer"
    },
    "type": "text"
  }]
}

Static Location Message Received

The following is an example of a message received from a customer specifying their static location.

{
  "contacts": [ {
    "profile": {
        "name": "Kerry Fisher"
    },
    "wa_id": "16315551234"
  } ],
 "messages":[{
   "from":"16315551234",
   "id":"ABGGFlA5FpafAgo6tHcNmNjXmuSf",
   "location":{
      "address":"Main Street Beach, Santa Cruz, CA",
      "latitude":38.9806263495,
      "longitude":-131.9428612257,
      "name":"Main Street Beach",
      "url":"https://foursquare.com/v/4d7031d35b5df7744"},
   "timestamp":"1521497875",
   "type":"location"
  }]
}

Contacts Message Received

The following is an example of a message received from a customer specifying their contact information.

{
    "contacts": [ {
        "profile": {
          "name": "Kerry Fisher"
        },
        "wa_id": "16315551234"
    } ],
    "messages": [
        {
            "contacts": [
                {
                    "addresses": [
                        {
                            "city": "Menlo Park",
                            "country": "United States",
                            "country_code": "us",
                            "state": "CA",
                            "street": "1 Hacker Way",
                            "type": "WORK",
                            "zip": "94025"
                        }
                    ],
                    "birthday": "2012-08-18",
                    "emails": [
                        {
                            "email": "[email protected]",
                            "type": "WORK"
                        }
                    ],
                    "ims": [
                        {
                            "service": "AIM",
                            "user_id": "kfish"
                        }
                    ],
                    "name": {
                        "first_name": "Kerry",
                        "formatted_name": "Kerry Fisher",
                        "last_name": "Fisher"
                    },
                    "org": {
                        "company": "Facebook"
                    },
                    "phones": [
                        {
                            "phone": "+1 (940) 555-1234",
                            "type": "CELL"
                        },
                        {
                            "phone": "+1 (650) 555-1234",
                            "type": "WORK",
                            "wa_id": "16505551234"
                        }
                    ],
                    "urls": [
                        {
                            "url": "https://www.facebook.com",
                            "type": "WORK"
                        }
                    ]
                }
            ],
            "from": "16505551234",
            "id": "ABGGFlA4dSRvAgo6C4Z53hMh1ugR",
            "timestamp": "1537248012",
            "type": "contacts"
        }
    ]
}

Message with Image Received

The following is an example inbound message that contains an image. See the media object section below to learn more about the different media types.

{
    "messages": [{
        "from": "16315551234",
        "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
        "image": {
            "file": "/usr/local/wamedia/shared/b1cf38-8734-4ad3-b4a1-ef0c10d0d683",
            "id": "b1c68f38-8734-4ad3-b4a1-ef0c10d683",
            "mime_type": "image/jpeg",
            "sha256": "29ed500fa64eb55fc19dc4124acb300e5dcc54a0f822a301ae99944db",
            "caption": "Check out my new phone!"
        },
        "timestamp": "1521497954",
        "type": "image"
    }]
}

Message with Document Received

The following is an example inbound message that contains a document. See the media object section below to learn more about the different media types.

{
    "messages": [{
        "from": "16315551234",
        "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
        "timestamp": "1522189546",
        "type": "document",
        "document": {
            "caption": "80skaraokesonglistartist",
            "file": "/usr/local/wamedia/shared/fc233119-733f-49c-bcbd-b2f68f798e33",
            "id": "fc233119-733f-49c-bcbd-b2f68f798e33",
            "mime_type": "application/pdf",
            "sha256": "3b11fa6ef2bde1dd14726e09d3edaf782120919d06f6484f32d5d5caa4b8e"
        }
    }]
}

Message with Voice Message Received

The following is an example inbound message that contains a voice message. See the media object section below to learn more about the different media types.

{
    "messages":[{
        "from": "16315551234",
        "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
        "timestamp": "1521827831",
        "type": "voice",
        "voice": {
            "file": "/usr/local/wamedia/shared/463e/b7ec/ff4e4d9bb1101879cbd411b2",
            "id": "463eb7ec-ff4e-4d9b-b110-1879cbd411b2",
            "mime_type": "audio/ogg; codecs=opus",
            "sha256": "fa9e1807d936b7cebe63654ea3a7912b1fa9479220258d823590521ef53b0710"}
  }]
}

Message with Sticker Received

The following is an example inbound message that contains a sticker. See the media object section below to learn more about the different media types.

{
  "messages":[{
        "from": "16315551234",
        "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
        "timestamp": "1521827831",
        "type": "sticker",
        "sticker": {
            "id": "b1c68f38-8734-4ad3-b4a1-ef0c10d683",
            "metadata": {
                "sticker-pack-id": "463eb7ec-ff4e-4d9b-b110-1879cbd411b2",
                "sticker-pack-name" : "Happy New Year",
                "sticker-pack-publisher" : "Kerry Fisher",
                "emojis": ["πŸ₯", "πŸ˜ƒ"],
                "ios-app-store-link" : "https://apps.apple.com/app/id3133333",
                "android-app-store-link" : "https://play.google.com/store/apps/details?id=com.example",
                "is-first-party-sticker" : 0 | 1 # integer
            },
            "mime_type": "image/webp",
            "sha256": "fa9e1807d936b7cebe63654ea3a7912b1fa9479220258d823590521ef53b0710"
        }
    }]
}

Customer Replied to Your Message

The following is an example of an inbound message that is a reply to a message that you sent. See the context object section below for more information.

{
  "contacts": [ {
    "profile": {
        "name": "Kerry Fisher"
    },
    "wa_id": "16315551234"
  } ],
   "messages":[{
      "context":{
         "from":"16315558011",
         "id":"ABGGFlA5FpafAgo6tHcNmNjXmuSf"
         },
      "from":"16315551234",
      "id":"gBGGFlA5FpafAgkOuJbRq54qwbM",
      "text":{"body":"Yes, count me in!"},
      "timestamp":"1521499915",
      "type":"text"
  }]
}

A User Changed Their Number

If the notify_user_change_number parameter is set to true in the application settings you will receive inbound system messages when a user changes their phone number.

{
    "messages": [
        {
            "from": "16315558889",
            "id": "ABGGFjFVWIifAzNzeXMtMTYzMTU1NTg4ODlAcy53aGF0c2FwcC5uZXQtMTU3NDA4MDEwMjIxMy1jaGFuZ2U",
            "system": {
                "body": "β€ŽUser A changed from β€Ž+1 (631) 555-8889 to β€Ž+1 (631) 555-8890β€Ž",
                "new_wa_id": "16315558890",
                "type": "user_changed_number"
            },
            "timestamp": "1574080102",
            "type": "system"
        }
    ]
}

Message Status Notifications

The WhatsApp Business API client sends notifications to inform you of the status of the messages between you and users.

When a message is sent successfully, you receive a notification when the message is sent, delivered, read, deleted or failed. The order of these notifications in your app may not reflect the actual timing of the message status. View the timestamp to determine the timing, if necessary.

The following message also delivered via webhook to your server endpoint.

Message Sent

Message sent by your business was received by the server

{
  "statuses":[{
    "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
    "recipient_id": "16315555555",
    "status": "sent",
    "type": "message",
    "timestamp": "1518694700",
    "conversation": {
        "expiration_timestamp": 1518694700,
        "id": "65e7904b7fe88fc80628f6f8477c34d3",
        "origin": {
          "type": "marketing"
        }
    },
    "pricing": {
        "billable": true,
        "category": "marketing",
        "pricing_model": "CBP"
    },
  }]
}

Message Delivered

Message sent by your business was delivered to the user's device.

{
  "statuses":[{
    "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
    "recipient_id": "16315555555",
    "status": "delivered",
    "timestamp": "1518694708",
    "type": "message",
    "conversation": {
        "expiration_timestamp": 1518694700,
        "id": "65e7904b7fe88fc80628f6f8477c34d3",
        "origin": {
          "type": "marketing"
        }
    },
    "pricing": {
        "billable": true,
        "category": "marketing",
        "pricing_model": "CBP"
    },
  }]
}

Message Read

Message sent by your business was read by the user read notifications will only be available for those users that have read receipts enabled. For users that do not have it enabled, you will only receive the delivered notification.

{
  "statuses":[{
    "id": "ABGGFlA5FpafAgo6tHcNmNjXmuSf",
    "recipient_id": "16315555555",
    "status": "read",
    "type": "message",
    "timestamp": "1518694722"
  }]
}

Message Deleted

Message the user sent to your business was deleted by the user. Upon receiving a "status": "deleted" notification, you should, in good faith, ensure that the message is deleted from your system if it was downloaded from the server.

{
  "statuses": [{
        "id": "ABGGFmkiWVVPAgo66iFiii_-TG0-",
        "recipient_id": "16692259554",
        "status": "deleted",
        "type": "message",
        "timestamp": "1532413514"
    }]
}

Message Failed

Message sent by your business failed to send A reason for the failure will be included in the callback.

When you get 480 error, you may send the message a next few minutes.

{
  "statuses": [{
    "errors": [{
      "code": 470,
      "title": "Failed to send message because you are outside the support window for freeform messages to this user. Please use a valid HSM notification or reconsider."
    }],
    "id": "gBGGEgZHMlEfAgkM1RBkhDRr7t8",
    "recipient_id": "12064001000",
    "status": "failed",
    "timestamp": "1533332775"
  }]
}
{
    "statuses": [
        {
            "errors": [
                {
                    "code": 470,
                    "href": "https:\/\/developers.facebook.com\/docs\/whatsapp\/api\/errors\/",
                    "title": "Message failed to send because more than 24 hours have passed since the customer last replied to this number"
                }
            ],
            "id": "gBGHYoIYQIMZXwIJhuyBpuWCn4vI",
            "recipient_id": "6282184083195",
            "status": "failed",
            "timestamp": "1616562518"
        }
    ]
}
{
  "statuses": [{
      "errors": [{
          "code": 480,
          "title": "Failed to send message since we detect an identity change of the contact"
      }],
      "id": "gBGGFjFVU2AfAgldhhKwWDGSrTs",
      "recipient_id": "16315553601",
      "status": "failed",
      "timestamp": "1602535356"
   }]
}

Testing API in Sandbox

For testing purposes, you may send any message in Sandbox. These endpoints are supported in Sandbox.

Sending message example

requires authentication

You can send any message by prefixing the regular message endpoint with the sandbox. Here is an example how to send a common text message in Sandbox.

Example request:

curl -X POST \
    "https://waba.ivosights.com/sandbox/api/v1/messages/send-text-message" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"wa_id":"628123456789","text":"hello"}'
const url = new URL(
    "https://waba.ivosights.com/sandbox/api/v1/messages/send-text-message"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

let body = {
    wa_id: "628123456789",
    text: "hello"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body)
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://waba.ivosights.com/sandbox/api/v1/messages/send-text-message',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
        'json' => [
            'wa_id' => '628123456789',
            'text' => 'hello',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

{
    "messages": [
        {
            "id": "gBEGkYiEB1VXAglK1ZEqA1YKPrU"
        }
    ]
}

Request   

POST sandbox/api/v1/messages/send-text-message

Body Parameters

wa_id  string  
WhatsApp ID (it a phone number including country code prefix).

text  string  
Message content (max 4096 characters).

Retrieve WhatsApp Media example

requires authentication

Fetch Whatsapp media file like image, audio, video from incoming message

Example request:

curl -X GET \
    -G "https://waba.ivosights.com/sandbox/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68" \
    -H "X-API-KEY: {YOUR_API_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
const url = new URL(
    "https://waba.ivosights.com/sandbox/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68"
);

let headers = {
    "X-API-KEY": "{YOUR_API_KEY}",
    "Content-Type": "application/json",
    Accept: "application/json"
};

fetch(url, {
    method: "GET",
    headers
}).then(response => response.json());

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://waba.ivosights.com/sandbox/api/v1/media/f043afd0-f0ae-4b9c-ab3d-696fb4c8cd68',
    [
        'headers' => [
            'X-API-KEY' => '{YOUR_API_KEY}',
            'Accept' => 'application/json',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));

Example response (200):

<Binary data> -  Media file

Example response (404, file not found):

{
    "message": "File not found"
}

Request   

GET sandbox/api/v1/media/{id}

URL Parameters

id  string  
Media ID