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:
- Send message through API
- 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"
}
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
Received response:
Request failed with error:
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": {}
}
}
}
Received response:
Request failed with error:
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": {}
}
}
}
Received response:
Request failed with error:
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));
Received response:
Request failed with error:
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"
}
Received response:
Request failed with error:
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));
Received response:
Request failed with error:
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));
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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"
}
]
}
Received response:
Request failed with error:
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
Received response:
Request failed with error:
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"
}
}
Received response:
Request failed with error:
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"
}
}
Received response:
Request failed with error:
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"
}
}
Received response:
Request failed with error:
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"
}
}
Received response:
Request failed with error:
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"
}
}
Received response:
Request failed with error:
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));
Received response:
Request failed with error:
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"
}
}
]
}
Received response:
Request failed with error:
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));
Received response:
Request failed with error:
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.
sandbox/api/v1/messages/send-text-message
sandbox/api/v1/messages/send-template-message
sandbox/api/v1/messages/send-media-message
sandbox/api/v1/messages/send-location-message
sandbox/api/v1/messages/send-contact-message
sandbox/api/v1/messages/send-list-message
sandbox/api/v1/messages/send-reply-button-message
sandbox/api/v1/media
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"
}
]
}
Received response:
Request failed with error:
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"
}
Received response:
Request failed with error: