> ## Documentation Index
> Fetch the complete documentation index at: https://help.commbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Send WhatsApp Templated Message V2

> 

 This API sends a generated WhatsApp template from the **WhatsApp Business Account** (WABA) to a single recipient or to multiple recipients (up to 20).<br><br>
 **Key New Capabilities of V2 version**<br><br> 
Marketing and Utility Templates may have a header with text or added media (attached document, image, or video), a footer, and a call for action or quick reply buttons.<br>The API can also create CommBox object(s), support subchannels, and enable scheduled publishing by adding unix timestamp code to the schedule field (see the 'Send a template with text' example).<br><br></br>

 **Send Templated Message + Object data**<br><br>
 Sending any templated WhatsApp message with Object data also creates a conversation (Object) on the CommBox platform.<br><br>**Note:** Adding the **ManagerId** field with the agent’s Id (optional) will ensure the agent is reflected in various reports. Objects without a managerId will display conversations as being initiated by 'customer'. <br><br> The required and optional fields are described here: https://www.commbox.io/api/#operation/Create_Object

<br><br> **Send Templated Message with an Attached Media**<br><br>
 There are two ways to do so: 

a) Sending a Templated Message with a link to the file. Example below: 'Send a template with an attachment (doc)'.
<br><br>
 OR<br>

b) Use the /whatsapp/uploadmedia/{ENCRYPTED_STREAM_ID} API endpoint to upload the file to WhatsApp servers and then fetch the uploaded file ID from the response for sending a templated message with the attachment ID. See the 'Send a template with an attachment ID (video)' example. 

<br><br>**Authentication Templates**<br><br>

 See the Examples for sending an authentication template. <br><br>For more information:
<li> https://help.commbox.io/docs/creating-new-whatsapp-authentication-templates<br>
<li> https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines/#authentication-templates
   

## OpenAPI

````json POST /v2/whatsapp/sendtemplatedmessage/{ENCRYPTED_STREAM_ID}
{
  "openapi": "3.0.3",
  "info": {
    "title": "CommBox API",
    "x-logo": {
      "url": "https://www.commbox.io/logo/commbox_logo_large.png"
    },
    "version": "2.07",
    "termsOfService": "https://www.commbox.io/end-user-license-agreement-eula/",
    "contact": {
      "name": "commbox",
      "url": "https://www.commbox.io",
      "email": "contactus@commbox.io"
    }
  },
  "servers": [
    {
      "url": "https://api.commbox.io/",
      "description": "Production server"
    }
  ],
  "paths": {
    "/v2/whatsapp/sendtemplatedmessage/{ENCRYPTED_STREAM_ID}": {
      "post": {
        "tags": [
          "WhatsApp"
        ],
        "summary": "Send WhatsApp Templated Message V2",
        "description": "\n\n This API sends a generated WhatsApp template from the **WhatsApp Business Account** (WABA) to a single recipient or to multiple recipients (up to 20).<br><br>\n **Key New Capabilities of V2 version**<br><br> \nMarketing and Utility Templates may have a header with text or added media (attached document, image, or video), a footer, and a call for action or quick reply buttons.<br>The API can also create CommBox object(s), support subchannels, and enable scheduled publishing by adding unix timestamp code to the schedule field (see the 'Send a template with text' example).<br><br></br>\n\n **Send Templated Message + Object data**<br><br>\n Sending any templated WhatsApp message with Object data also creates a conversation (Object) on the CommBox platform.<br><br>**Note:** Adding the **ManagerId** field with the agent’s Id (optional) will ensure the agent is reflected in various reports. Objects without a managerId will display conversations as being initiated by 'customer'. <br><br> The required and optional fields are described here: https://www.commbox.io/api/#operation/Create_Object\n\n<br><br> **Send Templated Message with an Attached Media**<br><br>\n There are two ways to do so: \n\na) Sending a Templated Message with a link to the file. Example below: 'Send a template with an attachment (doc)'.\n<br><br>\n OR<br>\n\nb) Use the /whatsapp/uploadmedia/{ENCRYPTED_STREAM_ID} API endpoint to upload the file to WhatsApp servers and then fetch the uploaded file ID from the response for sending a templated message with the attachment ID. See the 'Send a template with an attachment ID (video)' example. \n\n<br><br>**Authentication Templates**<br><br>\n\n See the Examples for sending an authentication template. <br><br>For more information:\n<li> https://help.commbox.io/docs/creating-new-whatsapp-authentication-templates<br>\n<li> https://developers.facebook.com/docs/whatsapp/updates-to-pricing/new-template-guidelines/#authentication-templates\n   ",
        "operationId": "Send_Templated_Message_V2",
        "parameters": [
          {
            "name": "ENCRYPTED_STREAM_ID",
            "in": "path",
            "description": "CommBox generated encryption for the channel",
            "required": true,
            "schema": {
              "$ref": "#/components/parameters/ENCRYPTED_STREAM_ID/schema"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsApp_template"
              },
              "examples": {
                "Send a template with text": {
                  "value": {
                    "data": [
                      {
                        "schedule": 1739365010,
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "Text Template",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with text + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "Text Template",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "19172537000",
                            "Email": "John.D@gmail.com",
                            "Remarks": "Returning customer"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with 2 body parameters": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "Basic WA template",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "Hellooooo"
                                  },
                                  {
                                    "type": "text",
                                    "text": "my friend"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with header  & body parameters": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "Text Header & Body",
                            "language": {
                              "code": "he"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "text1"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "text2"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with header & body parameters + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280801",
                          "template": {
                            "name": "ren_text_header_body",
                            "language": {
                              "code": "he"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "text1"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "text2"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "97253720000",
                            "Email": "John.Doe@gmail.com",
                            "Remarks": "some remark for user"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with 3 body parameters + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280801",
                          "template": {
                            "name": "multiple_params_in_body",
                            "language": {
                              "code": "en_GB"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "https://www.commbox.io"
                                  },
                                  {
                                    "type": "text",
                                    "text": "https://www.commbox.io2"
                                  },
                                  {
                                    "type": "text",
                                    "text": "https://www.commbox.io3"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "97253720000",
                            "Email": "john.doe@gmail.com",
                            "Remarks": "some remark for user"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (image)": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "header_image",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "image",
                                    "image": {
                                      "link": "https://picsum.photos/200"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "hello"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (image) + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "test_wisspp_4",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "image",
                                    "image": {
                                      "link": "https://picsum.photos/200"
                                    }
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "97253720000",
                            "Email": "John.Doe@gmail.com",
                            "Remarks": "some remark for user"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (image) ID + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "image1",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "image",
                                    "image": {
                                      "id": "614927520593182"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "JPG"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 13,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "97253720000",
                            "Email": "john.doe@gmail.com",
                            "Remarks": "some remark for user"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (doc)": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280999",
                          "template": {
                            "name": "doc1",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "document",
                                    "document": {
                                      "link": "https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf",
                                      "filename": "African-lion.pdf"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "hello"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (doc) + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "doc1",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "document",
                                    "document": {
                                      "link": "https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf",
                                      "filename": "African-lion.pdf"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "hello"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "Ron",
                            "Phone1": "19172537000",
                            "Email": "john.doe@gmail.com",
                            "Remarks": "some remark for user"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (doc) ID + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "header_doc",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "document",
                                    "document": {
                                      "id": "550197337025434",
                                      "filename": "file-sample_150kB.pdf"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "PDF"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 13,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "97253720000",
                            "Email": "John.Doe@gmail.com",
                            "Remarks": "Just checking"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (video)": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "header_video",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "video",
                                    "video": {
                                      "link": "http://techslides.com/demos/sample-videos/small.mp4"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "hello"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (video) + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "header_video",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "video",
                                    "video": {
                                      "link": "http://techslides.com/demos/sample-videos/small.mp4"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "hello"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "Ron",
                            "Phone1": "972537280000",
                            "Email": "Ron.Doe@gmail.com",
                            "Remarks": "Sending video files is great"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a template with an attachment (video) ID + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "header_video",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "header",
                                "parameters": [
                                  {
                                    "type": "video",
                                    "video": {
                                      "id": "27f8b007-7750-418e-9852-b4f8b7f95b9f"
                                    }
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "Video_20221023_111733_014.mp4"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 13,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Lin",
                            "FirstName": "Robert",
                            "Phone1": "972537280000",
                            "Email": "Lin.R34@gmail.com",
                            "Remarks": "Deal of the day"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with 'Call a phone number' button": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "Call_a_phone_num_btn",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with 'Call a phone number' button + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "Call_a_phone_num_btn",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "9725372800000",
                            "Email": "John.Doe@gmail.com",
                            "Remarks": "Contatcts buttons are great"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with 'Call a phone number' + 'Visit a website' buttons": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "Call_and_Visit_a_Website_btns",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with 'Call a phone number' + 'Visit a website' buttons + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "Call_and_Visit_a_Website_btns",
                            "language": {
                              "code": "en"
                            },
                            "components": []
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 78121,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Doe",
                            "FirstName": "John",
                            "Phone1": "9725372800000",
                            "Email": "John.Doe@gmail.com",
                            "Remarks": "Contatcts buttons are great"
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with a Static URL button": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "static_url",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "Name"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with a Static URL button + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "static_url",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "Name"
                                  }
                                ]
                              }
                            ]
                          },
                          "object_data": {
                            "createChildObject": true,
                            "SubStreamId": 0,
                            "StatusId": 1,
                            "ManagerId": 78121,
                            "Content": {},
                            "User": {
                              "UniqueId": "01234567",
                              "LastName": "Fox",
                              "FirstName": "Johnny",
                              "Phone1": "9725372800000",
                              "Email": "john.fox53@gmail.com",
                              "Remarks": "Static URL is great"
                            }
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with a Dynamic URL button": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "dynamic_url",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "button",
                                "sub_type": "url",
                                "index": 0,
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "api"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Call-to-Action template with a Dynamic URL button + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "19172537000",
                          "template": {
                            "name": "url_dyn",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "button",
                                "sub_type": "url",
                                "index": 0,
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "api"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              }
                            ]
                          },
                          "object_data": {
                            "createChildObject": true,
                            "SubStreamId": 0,
                            "StatusId": 1,
                            "ManagerId": 78121,
                            "Content": {},
                            "User": {
                              "UniqueId": "01234567",
                              "LastName": "Fox",
                              "FirstName": "Johnny",
                              "Phone1": "9725372800000",
                              "Email": "john.fox53@gmail.com",
                              "Remarks": "Dynamic URL is great"
                            }
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Quick Reply template with 3 buttons": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "3 buttons",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send a Quick Reply template with 3 buttons + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "3 buttons",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              }
                            ]
                          },
                          "object_data": {
                            "createChildObject": true,
                            "SubStreamId": 0,
                            "StatusId": 1,
                            "ManagerId": 78121,
                            "Content": {},
                            "User": {
                              "UniqueId": "01234567",
                              "LastName": "Doe",
                              "FirstName": "John",
                              "Phone1": "9725372800000",
                              "Email": "John.Doe@gmail.com",
                              "Remarks": "Quick Reply with 3 Buttons is great"
                            }
                          }
                        }
                      }
                    ]
                  }
                },
                "Send an authentication template": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "auth_template",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "button",
                                "sub_type": "url",
                                "index": 0,
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "name"
                                  }
                                ]
                              }
                            ]
                          }
                        }
                      }
                    ]
                  }
                },
                "Send an authentication template + Object data": {
                  "value": {
                    "data": [
                      {
                        "template_data": {
                          "to": "972537280000",
                          "template": {
                            "name": "auth_template",
                            "language": {
                              "code": "en"
                            },
                            "components": [
                              {
                                "type": "button",
                                "sub_type": "url",
                                "index": 0,
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "COPY"
                                  }
                                ]
                              },
                              {
                                "type": "body",
                                "parameters": [
                                  {
                                    "type": "text",
                                    "text": "455455"
                                  }
                                ]
                              }
                            ]
                          }
                        },
                        "object_data": {
                          "createChildObject": true,
                          "SubStreamId": 0,
                          "StatusId": 1,
                          "ManagerId": 387123,
                          "Content": {},
                          "User": {
                            "UniqueId": "01234567",
                            "LastName": "Fox",
                            "FirstName": "David",
                            "Phone1": "9725372800000",
                            "Email": "david.fox53@gmail.com",
                            "Remarks": "Looking for a new device"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 200
                    },
                    "description": {
                      "type": "string",
                      "example": "Operation successful"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2024-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "recipient": {
                            "type": "string",
                            "description": "Recipient number",
                            "example": 972546663529
                          },
                          "id": {
                            "type": "string",
                            "example": "gBEGlyVGZjUpAgmyuqAHfxbHmnQ"
                          },
                          "status": {
                            "type": "integer",
                            "format": "int32",
                            "example": 200
                          },
                          "object_id": {
                            "type": "integer",
                            "format": "int64",
                            "example": 38383744,
                            "description": "Object ID. This is a commbox generated number (optional)"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "206": {
            "description": "Provider returned failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 206
                    },
                    "description": {
                      "type": "string",
                      "example": "Missing template parameter"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2024-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "recipient": {
                                "type": "string",
                                "description": "Recipient number",
                                "example": 972546663529
                              },
                              "id": {
                                "type": "string",
                                "example": "gBEGlyVGZjUpAgmyuqAHfxbHmnQ"
                              },
                              "status": {
                                "type": "integer",
                                "format": "int32",
                                "example": 200
                              },
                              "object_id": {
                                "type": "integer",
                                "format": "int64",
                                "example": 38383744,
                                "description": "Object ID. This is a commbox generated number (optional)"
                              }
                            }
                          },
                          {
                            "type": "object",
                            "properties": {
                              "recipient": {
                                "type": "string",
                                "description": "Recipient number",
                                "example": 972546663529
                              },
                              "status": {
                                "type": "integer",
                                "format": "int32",
                                "example": 400
                              },
                              "failed": {
                                "type": "object",
                                "example": "invalid — Not a valid WhatsApp user"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Provider returned failure",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": 400
                    },
                    "description": {
                      "type": "string",
                      "example": "Missing parameter template_name"
                    },
                    "response_time": {
                      "type": "string",
                      "example": "2024-08-06T07:51:52.2581942Z"
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "recipient": {
                                "type": "string",
                                "description": "Recipient number",
                                "example": 972546663529
                              },
                              "status": {
                                "type": "integer",
                                "format": "int32",
                                "example": 400
                              },
                              "failed": {
                                "type": "object",
                                "example": "invalid — Not a valid WhatsApp user"
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized - The supplied credentials, if any, are not sufficient to access the resource",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 401
                    },
                    "description": {
                      "type": "string",
                      "example": "Unauthorized"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not found - The requested resource is not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 404
                    },
                    "description": {
                      "type": "string",
                      "example": "Not Found"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests - Too many requests have been made in a short period of time (Throttling)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 429
                    },
                    "description": {
                      "type": "string",
                      "example": "Too Many Requests"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server Error - The server could not return the representation due to an internal server error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 500
                    },
                    "description": {
                      "type": "string",
                      "example": "Internal Server Error"
                    },
                    "response_time": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-02-06T07:51:52.2581942Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "WhatsApp_template": {
        "type": "object",
        "properties": {
          "schedule": {
            "type": "string",
            "description": "(Optional) Enter a Unix timestamp code for the desired scheduled date. Leaving it empty will send the template immediately."
          },
          "to": {
            "type": "integer",
            "description": "The recipient's phone number in international format"
          },
          "template": {
            "type": "object",
            "description": "Template configuration",
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the approved WhatsApp template"
              },
              "language": {
                "type": "object",
                "description": "Specifies the language of the template",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "Language code used by Meta. For example 'en_us'"
                  }
                }
              }
            }
          },
          "componentsA": {
            "type": "object",
            "description": "Components may include the body, header, footer, and buttons of the template",
            "properties": {
              "type": {
                "type": "string",
                "description": "The type of component. In this example 'body'"
              },
              "parameters": {
                "type": "object",
                "description": "Represents a single parameter for the placeholder",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of parameter. WhatsApp supports \"text\", \"image\", “video”, and \"document\" parameters."
                  },
                  "text": {
                    "type": "string",
                    "description": "the text entered in the parameter for example \"John\""
                  }
                }
              }
            }
          },
          "componentsB": {
            "type": "object",
            "description": "Components may include the body, header, footer, and buttons of the template",
            "properties": {
              "type": {
                "type": "string",
                "description": "The type of component. In this example 'header'"
              },
              "parametersA": {
                "type": "object",
                "description": "Represents a single parameter for the placeholder",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of parameter (e.g. image). WhatsApp supports \"text\", \"image\", “video”, and \"document\" parameters."
                  },
                  "image": {
                    "type": "object",
                    "properties": {
                      "Link": {
                        "type": "string",
                        "description": "The URL for the image attachment (e.g. https://picsum.photos/200)."
                      },
                      "id": {
                        "type": "string",
                        "description": "Instead of the link, enter media id provided by META when using the Whatsapp_uploadMedia API (e.g. 1628862997611773)"
                      }
                    }
                  }
                }
              },
              "parametersB": {
                "type": "object",
                "description": "Represents a single parameter for the placeholder",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of parameter. WhatsApp supports \"text\", \"image\", “video”, and \"document\" parameters."
                  },
                  "video": {
                    "type": "object",
                    "properties": {
                      "Link": {
                        "type": "string",
                        "description": "The URL for the video attachment (e.g http://example.com/video.mp4)."
                      }
                    }
                  }
                }
              },
              "parametersC": {
                "type": "object",
                "description": "Represents a single parameter for the placeholder",
                "properties": {
                  "type": {
                    "type": "string",
                    "description": "The type of parameter. WhatsApp supports \"text\", \"image\", “video”, and \"document\" parameters."
                  },
                  "document": {
                    "type": "object",
                    "properties": {
                      "Link": {
                        "type": "string",
                        "description": "The URL of the PDF attachment (e.g. https://denverzoo.org/wp-content/uploads/2018/09/African-lion.pdf)."
                      },
                      "filename": {
                        "type": "string",
                        "description": "The file's name (e.g. African-lion.pdf)"
                      }
                    }
                  }
                }
              }
            }
          },
          "object_data": {
            "type": "object",
            "required": [
              "createChildObject",
              "streamId",
              "SubStreamId",
              "StatusId",
              "ManagerId",
              "Content",
              "User"
            ],
            "properties": {
              "createChildObject": {
                "type": "boolean",
                "example": true
              },
              "streamId": {
                "type": "integer",
                "description": "The channel's ID"
              },
              "SubStreamId": {
                "type": "integer",
                "description": "The subchannel's ID. When there are no subchannels, value is 0",
                "example": 0
              },
              "StatusId": {
                "type": "integer",
                "description": "Status of conversation - see Enums",
                "example": 1
              },
              "ManagerId": {
                "type": "integer",
                "description": "ID of the agent",
                "example": 78121
              },
              "Content": {
                "type": "object",
                "description": "Content of the message"
              },
              "User": {
                "type": "object",
                "required": [
                  "Phone1",
                  "Email"
                ],
                "properties": {
                  "UniqueId": {
                    "type": "string",
                    "description": "Unique identifier of the customer such as Social Security number or national ID, or a unique ID generated by the organization",
                    "example": "01234567"
                  },
                  "LastName": {
                    "type": "string",
                    "example": "Doe"
                  },
                  "FirstName": {
                    "type": "string",
                    "example": "John"
                  },
                  "Phone1": {
                    "type": "string",
                    "description": "Phone number including country code",
                    "example": "442079834000"
                  },
                  "Email": {
                    "type": "string",
                    "format": "email",
                    "example": "John.D@gmail.com"
                  },
                  "Remarks": {
                    "type": "string",
                    "example": "Returning customer"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
````

