# SMS API

## Using the SMS API

To use the Message REST API you need an account. Please get in touch with the Ebbot team if you don't have access to an account. Send us an email <helpme@ebbot.ai> to request an account.

### Base URL for SMS API

The base URL for Ebbot's SMS API is `https://api.ebbot.ai/sms/v1`

### Authentication

Each request should include auth header with the key `x-api-key` followed by your private token

**Auth header:**

```json
POST /sms/v1 HTTP/1.1
Host: api.ebbot.ai
x-api-key: your_api_key
Content-Type: application/json
```

**401 Unauthorized:** Will be returned if your credentials are wrong or you have insufficient privileges.

### Send message

Example on how to send a message using the SMS API:

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

```url
curl --location 'https://api.ebbot.ai/sms/v1' \
--header 'x-api-key: your_api_key' \
--header 'Content-Type: application/json' \
--data '{"from": "The Company", "to": "+1234567", "text": "This is a message!"}'
```

{% endtab %}

{% tab title="Python - Requests" %}

```python
import requests
import json

url = "https://api.ebbot.ai/sms/v1"

payload = json.dumps({
  "from": "The Company",
  "to": "+1234567",
  "text": "This is a message!"
})
headers = {
  'x-api-key': 'your_api_key',
  'Content-Type': 'application/json'
}

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

print(response.text)
```

{% endtab %}
{% endtabs %}

This endpoint allows you to get free cake

**Body parameters:**

| Name | Type   | Description                                                                 |
| ---- | ------ | --------------------------------------------------------------------------- |
| from | string | The senders name or number.                                                 |
| to   | string | The recipients phone number. in E.164 format. **Example:** `"+46731234567"` |
| text | string | The text message to be sent.                                                |

**Headers:**

| Name      | Type   | Description                |
| --------- | ------ | -------------------------- |
| x-api-key | string | API key provided by Ebbot. |

**Example response:**

{% tabs %}
{% tab title="201 Created" %}

```
{
    "MessageId": [
        "5ec1dcbf-01ac-4322-9d20-a4284693f7a"
    ]
}
```

{% endtab %}
{% endtabs %}

<br>


---

# 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://docs.ebbot.ai/ebbot-docs/developer-resources/ebbot-chat/sms-api.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.
