<?php
$ch = curl_init("https://api.getreply.in/v1/campaigns");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer gr_live_…",
"Idempotency-Key: campaign-diwali-2026",
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => '{"name": "Diwali offer", "template": {"name": "diwali_offer", "language": "en"}, "audience": {"tag": "VIP"}, "values": {"body": [{"from": "contact.name", "default": "there"}, "20%"], "buttons": [{"type": "copy_code", "value": "DIWALI20"}]}, "header_media": {"type": "image", "url": "https://example.com/offer.jpg"}}',
]);
echo curl_exec($ch);