# Communication

## Ping

<mark style="color:blue;">`GET`</mark> `https://api-<region>.renda.io/communication/ping`

Heartbeat Check

#### Headers

| Name      | Type   | Description   |
| --------- | ------ | ------------- |
| x-api-key | string | Renda API Key |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
[
    {
        "type": "Success",
        "message": "Renda.io ping successful"
    }
]
```

{% endtab %}

{% tab title="403 Could not find a cake matching this query." %}

```
{
    "message": "Unsupported API request. Please refer to Renda 
    documentation for more details documentation.renda.io"
}
```

{% endtab %}
{% endtabs %}

## Send SMS

<mark style="color:green;">`POST`</mark> `https://api-<region>.renda.io/communication/sendSMS`

#### Headers

| Name      | Type   | Description |
| --------- | ------ | ----------- |
| x-api-key | string |             |

#### Request Body

| Name       | Type   | Description                                                                                                                          |
| ---------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| number     | string | <p>Valid Mobile number <br><br>+441234567890<br>00441234567890<br><br>\<country code> + \<mobile number></p>                         |
| message    | string | SMS Text                                                                                                                             |
| senderName | string | <p>Sender Name<br><br>3-11 chars if alphanumeric <br>3-15 chars if numeric <br>Spaces and special characters are not allowed<br></p> |

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

```
{
    "messageid": "612733016353393435",
    "status": "SENT"
}
```

{% endtab %}

{% tab title="400 " %}

```
//When invalid mobile number and message is provided
[
    {
        "type": "Error",
        "message": "Invalid mobile number"
    },
    {
        "type": "Error",
        "message": "Invalid message content"
    }
]


//When Invalid destination number is provided
{
    "status": "error",
    "errorCode": 4004,
    "message": "Invalid destination number.",
    "permanent": true
}
```

{% endtab %}

{% tab title="403 " %}

```
{
    "message": "Unsupported API request. Please refer to Renda 
    documentation for more details https://documentation.renda.io"
}
```

{% endtab %}
{% endtabs %}
