# Send SMS (v1)

{% hint style="info" %}
`https://sms.textcus.com/api/send?destination={recipient}&source={sender}&dlr={0}&type={0}&message={message}`
{% endhint %}

<mark style="color:red;">NB: Please remove the curly bracket in the URL when testing</mark>

<mark style="color:$danger;">**API v1.0 has been discontinued and will no longer be supported. Please use API v2.0.**</mark>

## Endpoint <a href="#endpoint" id="endpoint"></a>

<mark style="color:green;">**`GET`**</mark> `https://sms.textcus.com/api/send`

## **Request Parameters**

Below is a list of parameters when issuing an HTTP Request.

<table><thead><tr><th width="226">Parameters</th><th width="160">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>type</code></td><td>Required</td><td>It indicates the type of message.<br>Values for "type" include:<br>0 : Plain text (GSM 3.38 Character encoding)<br>1 : Flash (GSM 3.38 Character encoding)<br>2 : Unicode<br>3 : Reserved<br>5 : Plain text (ISO-8859-1 Character encoding)<br>6 : Unicode Flash<br>7 : Flash (ISO-8859-1 Character encoding)</td></tr><tr><td><code>source</code></td><td>Required</td><td>The source address that should appear in the message.<br>- Max Length of 18 if numeric.<br>- Max Length of 11 if alphanumeric.<br>To prefix the plus sign (+) to the sender’s address when the message is displayed on their mobile phone, please prefix the plus sign to your sender’s address while submitting the message.<br>Note: You need to URL encode the plus sign. The SMSC may enforce additional restrictions on this field.</td></tr><tr><td><code>destination</code></td><td>Required</td><td>Recipient phone number<br>Must be a valid MSIDSN<br>Must be in the international telephone number format (may or may not include a plus [+] sign) symbol. e.g. 233241234567 or +233241234567<br>Multiple mobile numbers need to be separated by a comma (,) (the comma should be URL encoded).</td></tr><tr><td><code>dlr</code></td><td>Required</td><td>Indicates whether the client wants a delivery report for this message.<br>The values for "dlr" include:<br>0 : No delivery report required<br>1 : Delivery report required</td></tr><tr><td><code>message</code></td><td>Required</td><td>The message to be sent. Must be URL encoded.</td></tr><tr><td><code>time</code></td><td>Optional</td><td>To schedule the message to be sent sometime or date in the future<br>Format: YYYY-MM-DD HH:MM:SS or UNIX TIMESTAMP<br>The Scheduled time must be at least 10 minutes ahead of the current time in UTC</td></tr></tbody></table>

## Sample Requests <a href="#sample-requests" id="sample-requests"></a>

{% tabs %}
{% tab title="PHP" %}

```php
<?php

//defining the parameters
$apiKey = '63f113a2d1d06b27ebd33a4ui63e71902al3'; //Remember to put your account API Key here
$recipient = 23324xxxxxxx; //International format (233) excluding the (+)
$sender = 'TextCus'; //11 Characters maximum
$msg = "Hello, TextCus SMS is the best!";

//encode the message
$message = urlencode($msg);

$url = 'https://sms.textcus.com/api/send?apikey=' . $apiKey . '&destination=' . $recipient . '&source=' . $sender . '&dlr=0&type=0' . '&message=' . $message . '';

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => $url,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

?>
```

{% endtab %}
{% endtabs %}

## Sample Response <a href="#sample-response" id="sample-response"></a>

{% tabs %}
{% tab title="Success" %}

```json
{
    "status": 200,
    "message": "Message sent successfully"
}
```

{% endtab %}

{% tab title="Errors" %}

```json
{
    "status": 401,
    "error": "Authentication invalid"
}, 

{
    "status": 401,
    "error": "Unauthorized: Invalid API Key"
}
```

{% endtab %}
{% endtabs %}
