[{"data":1,"prerenderedAt":256},["ShallowReactive",2],{"help-article-integrations-sending-messages-api-templates":3,"help-siblings-integrations":223},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"category":5,"order":10,"difficulty":11,"time_to_complete":12,"related":13,"body":17,"_type":217,"_id":218,"_source":219,"_file":220,"_stem":221,"_extension":222},"\u002Fhelp\u002Fintegrations\u002Fsending-messages-api-templates","integrations",false,"","Sending messages via API (advanced)","Advanced API usage — sending templates with media headers, buttons, and handling responses.",6,"advanced","5 minutes",[14,15,16],"\u002Fhelp\u002Fintegrations\u002Fsending-messages-api","\u002Fhelp\u002Fintegrations\u002Fapi-overview","\u002Fhelp\u002Fsettings\u002Fcreating-templates",{"type":18,"children":19,"toc":205},"root",[20,29,35,42,55,61,70,76,83,92,98,107,113,118,155,161],{"type":21,"tag":22,"props":23,"children":25},"element","h1",{"id":24},"advanced-api-messaging",[26],{"type":27,"value":28},"text","Advanced API messaging",{"type":21,"tag":30,"props":31,"children":32},"p",{},[33],{"type":27,"value":34},"Send complex messages with media headers, buttons, and template parameters via the API.",{"type":21,"tag":36,"props":37,"children":39},"h2",{"id":38},"template-with-image-header",[40],{"type":27,"value":41},"Template with image header",{"type":21,"tag":43,"props":44,"children":49},"pre",{"className":45,"code":47,"language":48,"meta":7},[46],"language-json","{\n  \"to\": \"+919876543210\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"order_shipped\",\n    \"language\": \"en\",\n    \"components\": [\n      {\n        \"type\": \"header\",\n        \"parameters\": [\n          { \"type\": \"image\", \"image\": { \"link\": \"https:\u002F\u002Fexample.com\u002Ftracking-map.jpg\" } }\n        ]\n      },\n      {\n        \"type\": \"body\",\n        \"parameters\": [\n          { \"type\": \"text\", \"text\": \"John\" },\n          { \"type\": \"text\", \"text\": \"ORD-789\" },\n          { \"type\": \"text\", \"text\": \"May 30, 2026\" }\n        ]\n      }\n    ]\n  }\n}\n","json",[50],{"type":21,"tag":51,"props":52,"children":53},"code",{"__ignoreMap":7},[54],{"type":27,"value":47},{"type":21,"tag":36,"props":56,"children":58},{"id":57},"template-with-url-button-variable",[59],{"type":27,"value":60},"Template with URL button variable",{"type":21,"tag":43,"props":62,"children":65},{"className":63,"code":64,"language":48,"meta":7},[46],"{\n  \"to\": \"+919876543210\",\n  \"type\": \"template\",\n  \"template\": {\n    \"name\": \"track_order\",\n    \"language\": \"en\",\n    \"components\": [\n      {\n        \"type\": \"body\",\n        \"parameters\": [\n          { \"type\": \"text\", \"text\": \"ORD-789\" }\n        ]\n      },\n      {\n        \"type\": \"button\",\n        \"sub_type\": \"url\",\n        \"index\": 0,\n        \"parameters\": [\n          { \"type\": \"text\", \"text\": \"ORD-789\" }\n        ]\n      }\n    ]\n  }\n}\n",[66],{"type":21,"tag":51,"props":67,"children":68},{"__ignoreMap":7},[69],{"type":27,"value":64},{"type":21,"tag":36,"props":71,"children":73},{"id":72},"handling-api-responses",[74],{"type":27,"value":75},"Handling API responses",{"type":21,"tag":77,"props":78,"children":80},"h3",{"id":79},"success",[81],{"type":27,"value":82},"Success",{"type":21,"tag":43,"props":84,"children":87},{"className":85,"code":86,"language":48,"meta":7},[46],"{\n  \"data\": {\n    \"message_id\": \"wamid.HBgLOTE5ODc2...\",\n    \"status\": \"sent\"\n  }\n}\n",[88],{"type":21,"tag":51,"props":89,"children":90},{"__ignoreMap":7},[91],{"type":27,"value":86},{"type":21,"tag":77,"props":93,"children":95},{"id":94},"failure",[96],{"type":27,"value":97},"Failure",{"type":21,"tag":43,"props":99,"children":102},{"className":100,"code":101,"language":48,"meta":7},[46],"{\n  \"message\": \"Template 'xyz' not found or not approved\",\n  \"status\": \"error\"\n}\n",[103],{"type":21,"tag":51,"props":104,"children":105},{"__ignoreMap":7},[106],{"type":27,"value":101},{"type":21,"tag":36,"props":108,"children":110},{"id":109},"webhook-for-delivery-updates",[111],{"type":27,"value":112},"Webhook for delivery updates",{"type":21,"tag":30,"props":114,"children":115},{},[116],{"type":27,"value":117},"After sending, receive delivery updates via webhook:",{"type":21,"tag":119,"props":120,"children":121},"ol",{},[122,142],{"type":21,"tag":123,"props":124,"children":125},"li",{},[126,128,134,136],{"type":27,"value":127},"Set up a webhook for ",{"type":21,"tag":51,"props":129,"children":131},{"className":130},[],[132],{"type":27,"value":133},"message.delivered",{"type":27,"value":135}," and ",{"type":21,"tag":51,"props":137,"children":139},{"className":138},[],[140],{"type":27,"value":141},"message.read",{"type":21,"tag":123,"props":143,"children":144},{},[145,147,153],{"type":27,"value":146},"Match by ",{"type":21,"tag":51,"props":148,"children":150},{"className":149},[],[151],{"type":27,"value":152},"message_id",{"type":27,"value":154}," to track each message",{"type":21,"tag":36,"props":156,"children":158},{"id":157},"tips",[159],{"type":27,"value":160},"Tips",{"type":21,"tag":119,"props":162,"children":163},{},[164,175,185,195],{"type":21,"tag":123,"props":165,"children":166},{},[167,173],{"type":21,"tag":168,"props":169,"children":170},"strong",{},[171],{"type":27,"value":172},"Validate before sending",{"type":27,"value":174}," — Check template exists and is approved",{"type":21,"tag":123,"props":176,"children":177},{},[178,183],{"type":21,"tag":168,"props":179,"children":180},{},[181],{"type":27,"value":182},"Match parameter count",{"type":27,"value":184}," — Must match template exactly",{"type":21,"tag":123,"props":186,"children":187},{},[188,193],{"type":21,"tag":168,"props":189,"children":190},{},[191],{"type":27,"value":192},"Use HTTPS for media URLs",{"type":27,"value":194}," — HTTP links are rejected",{"type":21,"tag":123,"props":196,"children":197},{},[198,203],{"type":21,"tag":168,"props":199,"children":200},{},[201],{"type":27,"value":202},"Handle errors",{"type":27,"value":204}," — Implement retry for 429\u002F500, don't retry 400",{"title":7,"searchDepth":206,"depth":206,"links":207},2,[208,209,210,215,216],{"id":38,"depth":206,"text":41},{"id":57,"depth":206,"text":60},{"id":72,"depth":206,"text":75,"children":211},[212,214],{"id":79,"depth":213,"text":82},3,{"id":94,"depth":213,"text":97},{"id":109,"depth":206,"text":112},{"id":157,"depth":206,"text":160},"markdown","content:help:integrations:sending-messages-api-templates.md","content","help\u002Fintegrations\u002Fsending-messages-api-templates.md","help\u002Fintegrations\u002Fsending-messages-api-templates","md",[224,226,229,232,235,238,241,243,244,247,250,253],{"_path":15,"title":225},"REST API overview and authentication",{"_path":227,"title":228},"\u002Fhelp\u002Fintegrations\u002Fapi-rate-limits","API rate limits and best practices",{"_path":230,"title":231},"\u002Fhelp\u002Fintegrations\u002Fcustom-js-actions","Using the JavaScript VM for custom actions",{"_path":233,"title":234},"\u002Fhelp\u002Fintegrations\u002Ferror-codes","Error codes reference",{"_path":236,"title":237},"\u002Fhelp\u002Fintegrations\u002Fpayment-gateway","Payment gateway setup (Razorpay\u002FStripe)",{"_path":239,"title":240},"\u002Fhelp\u002Fintegrations\u002Fproduct-catalog-sync","Product catalog sync from Meta",{"_path":14,"title":242},"Sending messages via API",{"_path":4,"title":8},{"_path":245,"title":246},"\u002Fhelp\u002Fintegrations\u002Fwebhook-events","Webhook event types reference",{"_path":248,"title":249},"\u002Fhelp\u002Fintegrations\u002Fwebhooks-receiving","Receiving messages via webhooks",{"_path":251,"title":252},"\u002Fhelp\u002Fintegrations\u002Fwoocommerce","WooCommerce integration setup",{"_path":254,"title":255},"\u002Fhelp\u002Fintegrations\u002Fzapier-pabbly","Connecting with Zapier and Pabbly Connect",1780423187652]