outside_24h_window.
Text
curl https://api.getreply.in/v1/messages/text \
-H "Authorization: Bearer gr_live_…" \
-H "Idempotency-Key: reply-4521-1" \
-H "Content-Type: application/json" \
-d '{"to": "+9198250*****", "text": "Your order is on its way."}'
const res = await fetch("https://api.getreply.in/v1/messages/text", {
method: "POST",
headers: {
"Authorization": "Bearer gr_live_…",
"Idempotency-Key": "reply-4521-1",
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "+9198250*****",
"text": "Your order is on its way."
}),
});
console.log(await res.json());
<?php
$ch = curl_init("https://api.getreply.in/v1/messages/text");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer gr_live_…",
"Idempotency-Key: reply-4521-1",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{"to": "+9198250*****", "text": "Your order is on its way."}',
]);
echo curl_exec($ch);
import requests
res = requests.post(
"https://api.getreply.in/v1/messages/text",
headers={
"Authorization": "Bearer gr_live_…",
"Idempotency-Key": "reply-4521-1",
},
json={
"to": "+9198250*****",
"text": "Your order is on its way."
},
)
print(res.json())
Buttons
curl https://api.getreply.in/v1/messages/interactive \
-H "Authorization: Bearer gr_live_…" \
-H "Idempotency-Key: reply-4521-2" \
-H "Content-Type: application/json" \
-d '{"to": "+9198250*****", "body": "Shall we deliver today?", "buttons": [{"id": "yes", "title": "Yes"}, {"id": "later", "title": "Later"}]}'
const res = await fetch("https://api.getreply.in/v1/messages/interactive", {
method: "POST",
headers: {
"Authorization": "Bearer gr_live_…",
"Idempotency-Key": "reply-4521-2",
"Content-Type": "application/json",
},
body: JSON.stringify({
"to": "+9198250*****",
"body": "Shall we deliver today?",
"buttons": [
{
"id": "yes",
"title": "Yes"
},
{
"id": "later",
"title": "Later"
}
]
}),
});
console.log(await res.json());
<?php
$ch = curl_init("https://api.getreply.in/v1/messages/interactive");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer gr_live_…",
"Idempotency-Key: reply-4521-2",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{"to": "+9198250*****", "body": "Shall we deliver today?", "buttons": [{"id": "yes", "title": "Yes"}, {"id": "later", "title": "Later"}]}',
]);
echo curl_exec($ch);
import requests
res = requests.post(
"https://api.getreply.in/v1/messages/interactive",
headers={
"Authorization": "Bearer gr_live_…",
"Idempotency-Key": "reply-4521-2",
},
json={
"to": "+9198250*****",
"body": "Shall we deliver today?",
"buttons": [
{
"id": "yes",
"title": "Yes"
},
{
"id": "later",
"title": "Later"
}
]
},
)
print(res.json())
message.received webhook with the button’s id as reply_id.