curl --request POST \
--url https://lazyapp.in/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"recipient": {
"value": "<string>"
},
"send_at": "2023-11-07T05:31:56Z",
"ttl_seconds": 1296030,
"body": "<string>",
"context": {
"message_id": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"components": [
{}
],
"category": "<string>",
"features": {
"cards": [
{
"header_media": "<string>",
"product_retailer_id": "<string>",
"catalog_id": "<string>",
"body": [
"<string>"
],
"buttons": {},
"quick_replies": {}
}
],
"voice_call": {
"ttl_minutes": 21600,
"payload": "<string>"
},
"tap_target": {
"url": "<string>",
"title": "<string>"
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"coupon_code": "<string>",
"offer_expires_at": "<string>",
"product_retailer_id": "<string>",
"thumbnail_product_retailer_id": "<string>",
"catalog_id": "<string>",
"sections": [
{
"title": "<string>",
"product_retailer_ids": [
"<string>"
]
}
]
},
"carousel": [
{
"media": "<string>",
"body": [
"<string>"
],
"buttons": {}
}
],
"message_activity_sharing": true,
"max_price_multiplier": 99
},
"media_id": "<string>",
"media_url": "<string>",
"caption": "<string>",
"filename": "<string>",
"latitude": 0,
"longitude": 0,
"name": "<string>",
"address": "<string>",
"contacts": [
{}
],
"interactive": {},
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"idempotency_key": "<string>",
"phone_number_id": "<string>",
"connection_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"preview_url": true,
"recipient_identity_key_hash": "<string>"
}
'import requests
url = "https://lazyapp.in/v1/messages"
payload = {
"to": "<string>",
"recipient": { "value": "<string>" },
"send_at": "2023-11-07T05:31:56Z",
"ttl_seconds": 1296030,
"body": "<string>",
"context": { "message_id": "<string>" },
"template": {
"name": "<string>",
"language": "<string>",
"components": [{}],
"category": "<string>",
"features": {
"cards": [
{
"header_media": "<string>",
"product_retailer_id": "<string>",
"catalog_id": "<string>",
"body": ["<string>"],
"buttons": {},
"quick_replies": {}
}
],
"voice_call": {
"ttl_minutes": 21600,
"payload": "<string>"
},
"tap_target": {
"url": "<string>",
"title": "<string>"
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"coupon_code": "<string>",
"offer_expires_at": "<string>",
"product_retailer_id": "<string>",
"thumbnail_product_retailer_id": "<string>",
"catalog_id": "<string>",
"sections": [
{
"title": "<string>",
"product_retailer_ids": ["<string>"]
}
]
},
"carousel": [
{
"media": "<string>",
"body": ["<string>"],
"buttons": {}
}
],
"message_activity_sharing": True,
"max_price_multiplier": 99
},
"media_id": "<string>",
"media_url": "<string>",
"caption": "<string>",
"filename": "<string>",
"latitude": 0,
"longitude": 0,
"name": "<string>",
"address": "<string>",
"contacts": [{}],
"interactive": {},
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"idempotency_key": "<string>",
"phone_number_id": "<string>",
"connection_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"preview_url": True,
"recipient_identity_key_hash": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
recipient: {value: '<string>'},
send_at: '2023-11-07T05:31:56Z',
ttl_seconds: 1296030,
body: JSON.stringify('<string>'),
context: {message_id: '<string>'},
template: {
name: '<string>',
language: '<string>',
components: [{}],
category: '<string>',
features: {
cards: [
{
header_media: '<string>',
product_retailer_id: '<string>',
catalog_id: '<string>',
body: JSON.stringify(['<string>']),
buttons: {},
quick_replies: {}
}
],
voice_call: {ttl_minutes: 21600, payload: '<string>'},
tap_target: {url: '<string>', title: '<string>'},
location: {
latitude: '<string>',
longitude: '<string>',
name: '<string>',
address: '<string>'
},
coupon_code: '<string>',
offer_expires_at: '<string>',
product_retailer_id: '<string>',
thumbnail_product_retailer_id: '<string>',
catalog_id: '<string>',
sections: [{title: '<string>', product_retailer_ids: ['<string>']}]
},
carousel: [{media: '<string>', body: JSON.stringify(['<string>']), buttons: {}}],
message_activity_sharing: true,
max_price_multiplier: 99
},
media_id: '<string>',
media_url: '<string>',
caption: '<string>',
filename: '<string>',
latitude: 0,
longitude: 0,
name: '<string>',
address: '<string>',
contacts: [{}],
interactive: {},
reaction: {message_id: '<string>', emoji: '<string>'},
idempotency_key: '<string>',
phone_number_id: '<string>',
connection_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
preview_url: true,
recipient_identity_key_hash: '<string>'
})
};
fetch('https://lazyapp.in/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lazyapp.in/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'recipient' => [
'value' => '<string>'
],
'send_at' => '2023-11-07T05:31:56Z',
'ttl_seconds' => 1296030,
'body' => '<string>',
'context' => [
'message_id' => '<string>'
],
'template' => [
'name' => '<string>',
'language' => '<string>',
'components' => [
[
]
],
'category' => '<string>',
'features' => [
'cards' => [
[
'header_media' => '<string>',
'product_retailer_id' => '<string>',
'catalog_id' => '<string>',
'body' => [
'<string>'
],
'buttons' => [
],
'quick_replies' => [
]
]
],
'voice_call' => [
'ttl_minutes' => 21600,
'payload' => '<string>'
],
'tap_target' => [
'url' => '<string>',
'title' => '<string>'
],
'location' => [
'latitude' => '<string>',
'longitude' => '<string>',
'name' => '<string>',
'address' => '<string>'
],
'coupon_code' => '<string>',
'offer_expires_at' => '<string>',
'product_retailer_id' => '<string>',
'thumbnail_product_retailer_id' => '<string>',
'catalog_id' => '<string>',
'sections' => [
[
'title' => '<string>',
'product_retailer_ids' => [
'<string>'
]
]
]
],
'carousel' => [
[
'media' => '<string>',
'body' => [
'<string>'
],
'buttons' => [
]
]
],
'message_activity_sharing' => true,
'max_price_multiplier' => 99
],
'media_id' => '<string>',
'media_url' => '<string>',
'caption' => '<string>',
'filename' => '<string>',
'latitude' => 0,
'longitude' => 0,
'name' => '<string>',
'address' => '<string>',
'contacts' => [
[
]
],
'interactive' => [
],
'reaction' => [
'message_id' => '<string>',
'emoji' => '<string>'
],
'idempotency_key' => '<string>',
'phone_number_id' => '<string>',
'connection_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'preview_url' => true,
'recipient_identity_key_hash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/messages"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"request_id": "<string>",
"status": "queued",
"acceptance_status": "<string>",
"type": "text",
"provider_message_id": "<string>",
"error_message": "<string>"
}{
"id": "<string>",
"status": "<string>",
"send_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Send a message
Send any supported WhatsApp message type. Set send_at to schedule instead of sending now, which returns 202 with a scheduled message id.
type defaults to text. Address the recipient with to, or with recipient.type/recipient.value to send to a BSUID.
Required scope: messages:send
curl --request POST \
--url https://lazyapp.in/v1/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"to": "<string>",
"recipient": {
"value": "<string>"
},
"send_at": "2023-11-07T05:31:56Z",
"ttl_seconds": 1296030,
"body": "<string>",
"context": {
"message_id": "<string>"
},
"template": {
"name": "<string>",
"language": "<string>",
"components": [
{}
],
"category": "<string>",
"features": {
"cards": [
{
"header_media": "<string>",
"product_retailer_id": "<string>",
"catalog_id": "<string>",
"body": [
"<string>"
],
"buttons": {},
"quick_replies": {}
}
],
"voice_call": {
"ttl_minutes": 21600,
"payload": "<string>"
},
"tap_target": {
"url": "<string>",
"title": "<string>"
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"coupon_code": "<string>",
"offer_expires_at": "<string>",
"product_retailer_id": "<string>",
"thumbnail_product_retailer_id": "<string>",
"catalog_id": "<string>",
"sections": [
{
"title": "<string>",
"product_retailer_ids": [
"<string>"
]
}
]
},
"carousel": [
{
"media": "<string>",
"body": [
"<string>"
],
"buttons": {}
}
],
"message_activity_sharing": true,
"max_price_multiplier": 99
},
"media_id": "<string>",
"media_url": "<string>",
"caption": "<string>",
"filename": "<string>",
"latitude": 0,
"longitude": 0,
"name": "<string>",
"address": "<string>",
"contacts": [
{}
],
"interactive": {},
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"idempotency_key": "<string>",
"phone_number_id": "<string>",
"connection_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"preview_url": true,
"recipient_identity_key_hash": "<string>"
}
'import requests
url = "https://lazyapp.in/v1/messages"
payload = {
"to": "<string>",
"recipient": { "value": "<string>" },
"send_at": "2023-11-07T05:31:56Z",
"ttl_seconds": 1296030,
"body": "<string>",
"context": { "message_id": "<string>" },
"template": {
"name": "<string>",
"language": "<string>",
"components": [{}],
"category": "<string>",
"features": {
"cards": [
{
"header_media": "<string>",
"product_retailer_id": "<string>",
"catalog_id": "<string>",
"body": ["<string>"],
"buttons": {},
"quick_replies": {}
}
],
"voice_call": {
"ttl_minutes": 21600,
"payload": "<string>"
},
"tap_target": {
"url": "<string>",
"title": "<string>"
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"coupon_code": "<string>",
"offer_expires_at": "<string>",
"product_retailer_id": "<string>",
"thumbnail_product_retailer_id": "<string>",
"catalog_id": "<string>",
"sections": [
{
"title": "<string>",
"product_retailer_ids": ["<string>"]
}
]
},
"carousel": [
{
"media": "<string>",
"body": ["<string>"],
"buttons": {}
}
],
"message_activity_sharing": True,
"max_price_multiplier": 99
},
"media_id": "<string>",
"media_url": "<string>",
"caption": "<string>",
"filename": "<string>",
"latitude": 0,
"longitude": 0,
"name": "<string>",
"address": "<string>",
"contacts": [{}],
"interactive": {},
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"idempotency_key": "<string>",
"phone_number_id": "<string>",
"connection_uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"preview_url": True,
"recipient_identity_key_hash": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
to: '<string>',
recipient: {value: '<string>'},
send_at: '2023-11-07T05:31:56Z',
ttl_seconds: 1296030,
body: JSON.stringify('<string>'),
context: {message_id: '<string>'},
template: {
name: '<string>',
language: '<string>',
components: [{}],
category: '<string>',
features: {
cards: [
{
header_media: '<string>',
product_retailer_id: '<string>',
catalog_id: '<string>',
body: JSON.stringify(['<string>']),
buttons: {},
quick_replies: {}
}
],
voice_call: {ttl_minutes: 21600, payload: '<string>'},
tap_target: {url: '<string>', title: '<string>'},
location: {
latitude: '<string>',
longitude: '<string>',
name: '<string>',
address: '<string>'
},
coupon_code: '<string>',
offer_expires_at: '<string>',
product_retailer_id: '<string>',
thumbnail_product_retailer_id: '<string>',
catalog_id: '<string>',
sections: [{title: '<string>', product_retailer_ids: ['<string>']}]
},
carousel: [{media: '<string>', body: JSON.stringify(['<string>']), buttons: {}}],
message_activity_sharing: true,
max_price_multiplier: 99
},
media_id: '<string>',
media_url: '<string>',
caption: '<string>',
filename: '<string>',
latitude: 0,
longitude: 0,
name: '<string>',
address: '<string>',
contacts: [{}],
interactive: {},
reaction: {message_id: '<string>', emoji: '<string>'},
idempotency_key: '<string>',
phone_number_id: '<string>',
connection_uuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
metadata: {},
preview_url: true,
recipient_identity_key_hash: '<string>'
})
};
fetch('https://lazyapp.in/v1/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lazyapp.in/v1/messages",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'to' => '<string>',
'recipient' => [
'value' => '<string>'
],
'send_at' => '2023-11-07T05:31:56Z',
'ttl_seconds' => 1296030,
'body' => '<string>',
'context' => [
'message_id' => '<string>'
],
'template' => [
'name' => '<string>',
'language' => '<string>',
'components' => [
[
]
],
'category' => '<string>',
'features' => [
'cards' => [
[
'header_media' => '<string>',
'product_retailer_id' => '<string>',
'catalog_id' => '<string>',
'body' => [
'<string>'
],
'buttons' => [
],
'quick_replies' => [
]
]
],
'voice_call' => [
'ttl_minutes' => 21600,
'payload' => '<string>'
],
'tap_target' => [
'url' => '<string>',
'title' => '<string>'
],
'location' => [
'latitude' => '<string>',
'longitude' => '<string>',
'name' => '<string>',
'address' => '<string>'
],
'coupon_code' => '<string>',
'offer_expires_at' => '<string>',
'product_retailer_id' => '<string>',
'thumbnail_product_retailer_id' => '<string>',
'catalog_id' => '<string>',
'sections' => [
[
'title' => '<string>',
'product_retailer_ids' => [
'<string>'
]
]
]
],
'carousel' => [
[
'media' => '<string>',
'body' => [
'<string>'
],
'buttons' => [
]
]
],
'message_activity_sharing' => true,
'max_price_multiplier' => 99
],
'media_id' => '<string>',
'media_url' => '<string>',
'caption' => '<string>',
'filename' => '<string>',
'latitude' => 0,
'longitude' => 0,
'name' => '<string>',
'address' => '<string>',
'contacts' => [
[
]
],
'interactive' => [
],
'reaction' => [
'message_id' => '<string>',
'emoji' => '<string>'
],
'idempotency_key' => '<string>',
'phone_number_id' => '<string>',
'connection_uuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'metadata' => [
],
'preview_url' => true,
'recipient_identity_key_hash' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lazyapp.in/v1/messages"
payload := strings.NewReader("{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lazyapp.in/v1/messages")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lazyapp.in/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"to\": \"<string>\",\n \"recipient\": {\n \"value\": \"<string>\"\n },\n \"send_at\": \"2023-11-07T05:31:56Z\",\n \"ttl_seconds\": 1296030,\n \"body\": \"<string>\",\n \"context\": {\n \"message_id\": \"<string>\"\n },\n \"template\": {\n \"name\": \"<string>\",\n \"language\": \"<string>\",\n \"components\": [\n {}\n ],\n \"category\": \"<string>\",\n \"features\": {\n \"cards\": [\n {\n \"header_media\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {},\n \"quick_replies\": {}\n }\n ],\n \"voice_call\": {\n \"ttl_minutes\": 21600,\n \"payload\": \"<string>\"\n },\n \"tap_target\": {\n \"url\": \"<string>\",\n \"title\": \"<string>\"\n },\n \"location\": {\n \"latitude\": \"<string>\",\n \"longitude\": \"<string>\",\n \"name\": \"<string>\",\n \"address\": \"<string>\"\n },\n \"coupon_code\": \"<string>\",\n \"offer_expires_at\": \"<string>\",\n \"product_retailer_id\": \"<string>\",\n \"thumbnail_product_retailer_id\": \"<string>\",\n \"catalog_id\": \"<string>\",\n \"sections\": [\n {\n \"title\": \"<string>\",\n \"product_retailer_ids\": [\n \"<string>\"\n ]\n }\n ]\n },\n \"carousel\": [\n {\n \"media\": \"<string>\",\n \"body\": [\n \"<string>\"\n ],\n \"buttons\": {}\n }\n ],\n \"message_activity_sharing\": true,\n \"max_price_multiplier\": 99\n },\n \"media_id\": \"<string>\",\n \"media_url\": \"<string>\",\n \"caption\": \"<string>\",\n \"filename\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"name\": \"<string>\",\n \"address\": \"<string>\",\n \"contacts\": [\n {}\n ],\n \"interactive\": {},\n \"reaction\": {\n \"message_id\": \"<string>\",\n \"emoji\": \"<string>\"\n },\n \"idempotency_key\": \"<string>\",\n \"phone_number_id\": \"<string>\",\n \"connection_uuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"metadata\": {},\n \"preview_url\": true,\n \"recipient_identity_key_hash\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"uuid": "<string>",
"request_id": "<string>",
"status": "queued",
"acceptance_status": "<string>",
"type": "text",
"provider_message_id": "<string>",
"error_message": "<string>"
}{
"id": "<string>",
"status": "<string>",
"send_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>",
"code": "<string>"
}Authorizations
Your API key, e.g. sk_live_... or sk_test_....
Headers
Optional. Makes this write safe to retry: the same key replays the first response instead of acting twice.
255Body
Defaults to text.
text, template, image, document, audio, video, sticker, location, contacts, interactive, reaction E.164 phone number, e.g. +919812345670.
32Show child attributes
Show child attributes
Schedule for later. Must be in the future.
Drop the message if it cannot be sent within this window.
60 <= x <= 2592000Text body, or media caption fallback.
4096Show child attributes
Show child attributes
Show child attributes
Show child attributes
A previously uploaded media id.
128Public URL LazyApp fetches and uploads.
20481024255-90 <= x <= 90-180 <= x <= 180Location name.
25510241 - 5 elementsWhatsApp's interactive object: button, list, cta_url, location_request_message, carousel, address_message (India only), flow, catalog and payment types. Button, list, link, location, carousel and address messages are checked against Meta's limits before sending. See the Interactive messages guide.
Show child attributes
Show child attributes
Legacy body-level dedupe. Prefer the Idempotency-Key header.
128Send from a specific number.
64Show child attributes
Show child attributes
Text only. Ask WhatsApp to show a preview of the first link in body.
Identity change check: deliver only if the contact's identity hash still matches. Defaults to the hash LazyApp stored.
128Response
Message accepted and sent.
LazyApp's stable id for the message.
Correlation id, echoed as X-Request-Id.
queued, sent, delivered, read, played, failed text, template, image, document, audio, video, sticker, location, contacts, interactive, reaction Meta's wamid.
Set only when status is failed.