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

# Send SMS

> To make it simple, We have designed a method which allows you to send SMS in a single line of the HTTP GET request

<AccordionGroup>
  <Accordion title="Simple SMS API">
    [https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424\&senderId=HELLOW\&route=transactional\&number=9112345678974\&message=your\_message\&submissionStatus=true](https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424\&senderId=HELLOW\&route=transactional\&number=9112345678974\&message=your_message\&submissionStatus=true)
  </Accordion>

  <Accordion title="Advanced SMS API">
    [https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=3456789\&senderId=IDENTY\&route=transactional\&number=919090909090\&message=your\_message\&isFlash=true\&dltTemplateId=1234\&dltEntityId=1234\&reportURL=https://webhook.site/0a276bc5-f0e4-4235-9006-b58b\&submissionStatus=true](https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=3456789\&senderId=IDENTY\&route=transactional\&number=919090909090\&message=your_message\&isFlash=true\&dltTemplateId=1234\&dltEntityId=1234\&reportURL=https://webhook.site/0a276bc5-f0e4-4235-9006-b58b\&submissionStatus=true)
  </Accordion>
</AccordionGroup>

#### Query

<ParamField query="apiKey" type="string" placeholder="Enter API key" required>
  This is a token used to validate requests coming from valid users. You can
  obtain this token from your Zixflow account's API keys section.
</ParamField>

<ParamField query="senderId" type="string" placeholder="Enter Sender name" required>
  The registered and approved Sender name to be used for the message.
</ParamField>

<ParamField query="route" type="string" placeholder="Enter message route" required>
  Type of connectivity for the message, such as promotional, transactional, or
  OTP.
</ParamField>

<ParamField query="number" type="string" placeholder="Enter phone number" required>
  The phone number with a country prefix to which the message will be sent.
</ParamField>

<ParamField query="message" type="string" placeholder="Enter message content" required>
  The content of the message that you want to send.
</ParamField>

<ParamField query="isFlash" type="boolean" placeholder="Enter true or false">
  (Optional) Set this parameter to true if you want to send a flash SMS via the
  API; otherwise, set it to false.
</ParamField>

<ParamField query="dltTemplateId" type="string" placeholder="Enter template ID">
  (Optional) Only applicable for India. If you want to pass a template ID
  directly via the API, you can do so with this parameter.
</ParamField>

<ParamField query="dltEntityId" type="string" placeholder="Enter entity ID">
  (Optional) Only applicable for India. If you want to pass an entity ID
  directly via the API, you can do so with this parameter.
</ParamField>

<ParamField query="reportURL" type="string" placeholder="Enter report URL">
  (Optional) Specify the URL where the user's report and deliveries should be
  delivered.
</ParamField>

<ParamField query="submissionStatus" type="boolean" placeholder="Enter true or false">
  (Optional) When a user wants to wait for submission status from the API, they
  must set this key to true. It is false by default.
</ParamField>

#### Response

<ResponseField name="status" type="boolean">
  Indicates whether the call was successful. true if successful, false if not.
</ResponseField>

<ResponseField name="message" type="string">
  success or error response message
</ResponseField>

#### Reports & Deliveries

In order to get delivery reports directly into your system you need to take care of few simple things.

1. Please make sure that, the URL passed in the field reportUrl, must accept HTTP POST request with JSON request body.

<Note>
  If you are sending an SMS using a GET URL, it is necessary to encode the message using the URL Encoding method before sending it. However, if you are using a POST API, there is no need to encode the message.

  For example, if the message is "Hi User 1 & User 2, Welcome to zixflow," it needs to be encoded as "Hi%20User%201%20%26%20User%202%2C%20Welcome%20to%20zixflow" using URL Encoding.

  You can use a tool like [https://www.urlencoder.org/](https://www.urlencoder.org/) for reference on how to properly encode your message.
</Note>

<RequestExample>
  ```bash cUrl theme={null}
  curl --location --request GET 'https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424&senderId=HELLOW&route=transactional&number=9112345678974&message=Your OTP is XXXX&submissionStatus=true'
  ```

  ```js Nodejs theme={null}
  var axios = require("axios");

  var config = {
    method: "get",
    url: "https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424&senderId=HELLOW&route=transactional&number=9112345678974&message=Your OTP is XXXX&submissionStatus=true",
    headers: {},
  };

  axios(config)
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function (error) {
      console.log(error);
    });
  ```

  ```py Python theme={null}
  import requests

  url = "https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424&senderId=HELLOW&route=transactional&number=9112345678974&message=Your OTP is XXXX&submissionStatus=true"

  payload={}
  headers = {}

  response = requests.request("GET", url, headers=headers, data=payload)

  print(response.text)

  ```

  ```java JAVA theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
  Request request = new Request.Builder()
    .url("https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424&senderId=HELLOW&route=transactional&number=9112345678974&message=Your OTP is XXXX&submissionStatus=true")
    .method("GET", null)
    .build();
  Response response = client.newCall(request).execute();
  ```

  ```dart DART theme={null}
  var request = http.Request('GET', Uri.parse('https://api.zixflow.com/api/apis/campaign/sms/send?apiKey=123424&senderId=HELLOW&route=transactional&number=9112345678974&message=Your OTP is XXXX&submissionStatus=true'));


  http.StreamedResponse response = await request.send();

  if (response.statusCode == 200) {
    print(await response.stream.bytesToString());
  }
  else {
    print(response.reasonPhrase);
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200-Success theme={null}
  {
    "status": true,
    "message": "SMS sent successfully"
  }
  ```

  ```json 400-Bad Request theme={null}
  {
    "status": false,
    "message": "Invalid data Provided"
  }
  ```

  ```json 401-Unauthorised theme={null}
  {
    "status": false,
    "message": "Unauthorised"
  }
  ```
</ResponseExample>
