Messaging API
Send different types of WhatsApp messages.
All requests are POST with Content-Type: application/json and must include the X-API-KEY header. Responses follow {message: string, success: boolean, code: number, data: any}.
Receivers must be E.164 digits without plus (e.g., 14155552671).
Common Parameters
Every message endpoint accepts these optional parameters in the request body to control delivery and tracking:
group(boolean): Set this totrueif thereceiveris a WhatsApp Group ID rather than a phone number. This ensures the message is correctly routed to the group chat.sendsAt(string | null): An ISO 8601 formatted date (e.g.,2024-12-25T10:00:00Z). If provided, Communiktor will schedule the message to be sent at the specified time. Usenullor omit it for immediate delivery.metadata(object): A custom JSON object of your choice. This data is not sent to the WhatsApp recipient but is stored by Communiktor. When a webhook event (likemessage.sentormessage.read) is triggered for this message, yourmetadatawill be included in the webhook payload, allowing you to easily link the event back to your internal systems (e.g., an order ID or a customer UUID).
Text
POST /messages/text
When to use it
- Send plain text updates, OTPs, and quick replies.
- Ideal for low-latency transactional notifications.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- text: string — The message text.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
import axios from 'axios';
const url = 'https://api.communiktor.com/messages/text';
const headers = {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
};
const body = {
instance: 'my-instance-1',
receiver: '14155552671',
text: 'Hello from Communiktor!',
group: false,
sendsAt: '2024-12-25T10:00:00Z', // Optional: schedule for later
metadata: { orderId: 'ORD-12345' }, // Optional: track in webhooks
};
axios.post(url, body, { headers })
.then(res => console.log(res.data))
.catch(err => console.error(err.response?.data || err.message));
const url = 'https://api.communiktor.com/messages/text';
const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY',
},
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
text: 'Hello from Communiktor!',
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}),
});
const data = await res.json();
console.log(data);
import requests
url = 'https://api.communiktor.com/messages/text'
headers = {
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
}
payload = {
'instance': 'my-instance-1',
'receiver': '14155552671',
'text': 'Hello from Communiktor!',
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
curl -X POST https://api.communiktor.com/messages/text \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"text": "Hello from Communiktor!",
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client([
'base_uri' => 'https://api.communiktor.com',
]);
$response = $client->post('/messages/text', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-KEY' => 'YOUR_API_KEY',
],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'text' => 'Hello from Communiktor!',
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345']
],
]);
echo $response->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/text');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'text' => 'Hello from Communiktor!',
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345']
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-API-KEY: YOUR_API_KEY'
],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
echo $response;
Image
POST /messages/image
When to use it
- Send product photos, tickets, receipts, or screenshots.
- Use viewOnce for sensitive content that should not persist in the chat.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible image URL.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- caption?: string — Optional text shown below the image.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/image \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/image.jpg",
"caption": "Order #12345",
"viewOnce": false,
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/image', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/image.jpg',
caption: 'Order #12345',
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/image', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/image.jpg',
caption: 'Order #12345',
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/image', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/image.jpg',
'caption' => 'Order #12345',
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/image');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/image.jpg',
'caption' => 'Order #12345',
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/image', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/image.jpg',
'caption': 'Order #12345',
'viewOnce': False,
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Video
POST /messages/video
When to use it
- Send feature demos, announcements, or short clips.
- Use asGif/asNote for lightweight previews when appropriate.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible video URL.
- asGif?: boolean — Send as short looping preview (no sound).
- asNote?: boolean — Send as a circular video note (like push-to-talk style).
- caption?: string — Optional text shown below the video.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/video \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/video.mp4",
"caption": "Feature demo",
"asGif": false,
"asNote": false,
"viewOnce": false,
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/video', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/video.mp4',
caption: 'Feature demo',
asGif: false,
asNote: false,
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/video', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/video.mp4',
caption: 'Feature demo',
asGif: false,
asNote: false,
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/video', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/video.mp4',
'caption' => 'Feature demo',
'asGif' => false,
'asNote' => false,
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/video');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/video.mp4',
'caption' => 'Feature demo',
'asGif' => false,
'asNote' => false,
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/video', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/video.mp4',
'caption': 'Feature demo',
'asGif': False,
'asNote': False,
'viewOnce': False,
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Audio
POST /messages/audio
When to use it
- Share voice notes, short audio confirmations, or hotline messages.
- Use asNote for a push-to-talk style waveform.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible audio URL.
- asNote?: boolean — Send as a voice note (push-to-talk style).
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/audio \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/audio.mp3",
"asNote": false,
"viewOnce": false,
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/audio', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/audio.mp3',
asNote: false,
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/audio', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/audio.mp3',
asNote: false,
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/audio', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/audio.mp3',
'asNote' => false,
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/audio');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/audio.mp3',
'asNote' => false,
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/audio', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/audio.mp3',
'asNote': False,
'viewOnce': False,
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Document
POST /messages/document
When to use it
- Send PDFs, invoices, contracts, or other business files.
- Set filename to control how the file appears to the recipient.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- url: string — Publicly accessible document URL.
- viewOnce?: boolean — If true, the media disappears after being viewed once.
- caption?: string — Optional text shown below the document.
- filename?: string — File name shown to the recipient.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/document \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"url": "https://example.com/invoice.pdf",
"caption": "Invoice May",
"filename": "invoice-may.pdf",
"viewOnce": false,
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/document', {
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/invoice.pdf',
caption: 'Invoice May',
filename: 'invoice-may.pdf',
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/document', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
url: 'https://example.com/invoice.pdf',
caption: 'Invoice May',
filename: 'invoice-may.pdf',
viewOnce: false,
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/document', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/invoice.pdf',
'caption' => 'Invoice May',
'filename' => 'invoice-may.pdf',
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/document');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'url' => 'https://example.com/invoice.pdf',
'caption' => 'Invoice May',
'filename' => 'invoice-may.pdf',
'viewOnce' => false,
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/document', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'url': 'https://example.com/invoice.pdf',
'caption': 'Invoice May',
'filename': 'invoice-may.pdf',
'viewOnce': False,
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
Location
POST /messages/location
When to use it
- Share store locations, delivery coordinates, or meeting points.
- Include name/address to display a readable pin name.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- location: object — Coordinates and label to pin on the map:
- latitude: number — Latitude in decimal degrees.
- longitude: number — Longitude in decimal degrees.
- name: string — Pin title shown to the user.
- address: string — Human‑readable address for the pin.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/location \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"location": {"latitude": 37.7749, "longitude": -122.4194, "name": "Communiktor HQ", "address": "1 Market St, San Francisco"},
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/location', {
instance: 'my-instance-1',
receiver: '14155552671',
location: { latitude: 37.7749, longitude: -122.4194, name: 'Communiktor HQ', address: '1 Market St, San Francisco' },
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/location', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
location: { latitude: 37.7749, longitude: -122.4194, name: 'Communiktor HQ', address: '1 Market St, San Francisco' },
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' },
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/location', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'location' => [ 'latitude' => 37.7749, 'longitude' => -122.4194, 'name' => 'Communiktor HQ', 'address' => '1 Market St, San Francisco' ],
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/location');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'location' => [ 'latitude' => 37.7749, 'longitude' => -122.4194, 'name' => 'Communiktor HQ', 'address' => '1 Market St, San Francisco' ],
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/location', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'location': { 'latitude': 37.7749, 'longitude': -122.4194, 'name': 'Communiktor HQ', 'address': '1 Market St, San Francisco' },
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())
vCard
POST /messages/vcard
When to use it
- Share a contact card for sales agents, stores, or support lines.
- Ensure the contact phone is E.164 digits to allow immediate messaging.
Body
- instance: string — Your instance identifier.
- receiver: string — E.164 digits without plus.
- name: string — Title of the card shown in the chat.
- contact: object with fields:
- fullname: string — Contact full name.
- phone: string — E.164 digits without plus.
- waid?: string — WhatsApp ID of the contact (if known).
- organization?: string — Company or organization name.
- title?: string — Role or job title.
- email?: string — Contact email address.
- url?: string — Website or profile URL.
- address?: string — Postal address.
- note?: string — Additional notes.
- group?: boolean — Set to true if the receiver is a WhatsApp group.
- sendsAt?: string | null — Optional ISO 8601 date to schedule the message.
- metadata?: object — Optional JSON object that will be returned in webhooks.
- curl
- Axios
- Fetch
- Guzzle
- curl (PHP)
- requests
curl -X POST https://api.communiktor.com/messages/vcard \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-d '{
"instance": "my-instance-1",
"receiver": "14155552671",
"name": "Sales Contact",
"contact": {
"fullname": "Jane Doe",
"phone": "14155552671",
"organization": "ACME Inc.",
"title": "Account Executive",
"email": "jane.doe@example.com",
"url": "https://example.com",
"address": "1 Market St, San Francisco",
"note": "VIP client handler"
},
"group": false,
"sendsAt": "2024-12-25T10:00:00Z",
"metadata": {"orderId": "ORD-12345"}
}'
import axios from 'axios';
await axios.post('https://api.communiktor.com/messages/vcard', {
instance: 'my-instance-1',
receiver: '14155552671',
name: 'Sales Contact',
contact: {
fullname: 'Jane Doe',
phone: '14155552671',
organization: 'ACME Inc.',
title: 'Account Executive',
email: 'jane.doe@example.com',
url: 'https://example.com',
address: '1 Market St, San Francisco',
note: 'VIP client handler'
},
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' }
}, { headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' } });
await fetch('https://api.communiktor.com/messages/vcard', {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-API-KEY': 'YOUR_API_KEY' },
body: JSON.stringify({
instance: 'my-instance-1',
receiver: '14155552671',
name: 'Sales Contact',
contact: {
fullname: 'Jane Doe',
phone: '14155552671',
organization: 'ACME Inc.',
title: 'Account Executive',
email: 'jane.doe@example.com',
url: 'https://example.com',
address: '1 Market St, San Francisco',
note: 'VIP client handler'
},
group: false,
sendsAt: '2024-12-25T10:00:00Z',
metadata: { orderId: 'ORD-12345' }
})
});
<?php
require 'vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'https://api.communiktor.com']);
$resp = $client->post('/messages/vcard', [
'headers' => [ 'Content-Type' => 'application/json', 'X-API-KEY' => 'YOUR_API_KEY' ],
'json' => [
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'name' => 'Sales Contact',
'contact' => [
'fullname' => 'Jane Doe',
'phone' => '14155552671',
'organization' => 'ACME Inc.',
'title' => 'Account Executive',
'email' => 'jane.doe@example.com',
'url' => 'https://example.com',
'address' => '1 Market St, San Francisco',
'note' => 'VIP client handler'
],
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]
]);
echo $resp->getBody();
<?php
$ch = curl_init('https://api.communiktor.com/messages/vcard');
$payload = json_encode([
'instance' => 'my-instance-1',
'receiver' => '14155552671',
'name' => 'Sales Contact',
'contact' => [
'fullname' => 'Jane Doe',
'phone' => '14155552671',
'organization' => 'ACME Inc.',
'title' => 'Account Executive',
'email' => 'jane.doe@example.com',
'url' => 'https://example.com',
'address' => '1 Market St, San Francisco',
'note' => 'VIP client handler'
],
'group' => false,
'sendsAt' => '2024-12-25T10:00:00Z',
'metadata' => ['orderId' => 'ORD-12345'],
]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'X-API-KEY: YOUR_API_KEY' ],
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $payload,
]);
$resp = curl_exec($ch);
if ($resp === false) { throw new Exception(curl_error($ch)); }
curl_close($ch);
echo $resp;
import requests
r = requests.post('https://api.communiktor.com/messages/vcard', json={
'instance': 'my-instance-1',
'receiver': '14155552671',
'name': 'Sales Contact',
'contact': {
'fullname': 'Jane Doe',
'phone': '14155552671',
'organization': 'ACME Inc.',
'title': 'Account Executive',
'email': 'jane.doe@example.com',
'url': 'https://example.com',
'address': '1 Market St, San Francisco',
'note': 'VIP client handler'
},
'group': False,
'sendsAt': '2024-12-25T10:00:00Z',
'metadata': {'orderId': 'ORD-12345'}
}, headers={
'Content-Type': 'application/json',
'X-API-KEY': 'YOUR_API_KEY'
})
print(r.json())