# Send SMS via HTTP (MT) Example

### <mark style="color:green;">`GET`</mark> `/srs/api/sendsms`

Send a customisable SMS message to a MSISDN.&#x20;

{% hint style="info" %}
Please note you must URL encode the MESSAGE\_TEXT parameter and VALUE must be set to 0 for a free message.
{% endhint %}

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

```hsts
curl -X GET -H "Content-type: application/json" 'https://hostname/srs/api/sendsms?USER_NAME=<account_id>&PASSWORD=<api_key>&ORIGINATOR=<SHORT CODE>&RECIPIENT=<MSISDN>&PROVIDER=<Network Provider>&KEYWORD=<Keyword>&MESSAGE_TEXT=Hello%20There!&VALUE=0'
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'Content-type': 'application/json',
}

data = 'USER_NAME=<account_id>&PASSWORD=<api_key>&ORIGINATOR=<SHORT CODE>&RECIPIENT=<MSISDN>&PROVIDER=<Network Provider>&KEYWORD=<Keyword>&MESSAGE_TEXT=Hello%20There!&VALUE=0'

response = requests.get('http://hostname/srs/api/sendsms', headers=headers, data=data)
```

{% endtab %}
{% endtabs %}

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `No Auth`          |

**Body**

| Parameter     | Type    | Example                          | Description                                       |
| ------------- | ------- | -------------------------------- | ------------------------------------------------- |
| account\_id   | string  | 43e36f50aaf111e272639171000000a9 | Your unique Mobivate account id.                  |
| password      | string  | 3b41d767316541bacef19d1382ac1e12 | Your unique associated Mobivate account api-key.  |
| originator    | integer | 12345                            | The associated shortcode for your service.        |
| recipient     | integer | XX7432104492                     | The recipient you want to send this message to.   |
| provider      | string  | Safaricom                        | The network you plan to send the SMS message via. |
| keyword       | string  | mv-100620006                     | Your unique Mobivate keyword for your service.    |
| message\_text | string  | Hello%20There!                   | The body of the text message you want to send.    |
| value         | integer | 10                               | The cost of receiving this SMS message.           |

**Response**

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

```json
{
  "MT-aabbccddeeff00112233445566778899"
}
```

{% endtab %}

{% tab title="511" %}

```json
{
  "error": "Username or Password incorrect"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Be aware for Premium SMS the cost must be set or the Short code's default value will be charged.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.mobivate.com/use-cases/send-sms-via-http-mt-example.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
