# P2P SMS

Peer to peer sms, where each message is sent to the corresponding message in the array.

## Get Cakes

<mark style="color:green;">`POST`</mark> `https://api.bitel.rest/api/v1/sms/p2p`

#### Request Body

| Name          | Type   | Description                                                        |
| ------------- | ------ | ------------------------------------------------------------------ |
| gatewayNumber | string | Gateway number from which the SMS will be sent (up to 100 numbers) |
| messages      | array  | array of messages                                                  |
| phoneNumbers  | array  | array of phone numbers                                             |

{% tabs %}
{% tab title="200 result contains the batchId(refer to SMS Detail page)Smaple" %}

```javascript
{
    "result": "ef85b4858c3f4329b0fea6c4769e4965",
    "error": null
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Please not the number of messages should match the number of phone numbers
{% endhint %}

#### Sample Request

```javascript
{
    "messages": [
        "Hi"
    ],
    "phoneNumbers": [
        "0912*******"
    ]
}
```

#### Error Codes

| Code           | Description                                                        |
| -------------- | ------------------------------------------------------------------ |
| InvalidRequest | Submitted data is invalid                                          |
| InvalidGateway | Gateway number is invalid, or the client doesn't have access to it |

{% hint style="info" %}

## Getting SMS Detail

In order to get the detail of a request, including the delivery status, balance subtracted, delivery time and more please refer to [**SMS Detail**](https://bitel.gitbook.io/bitel/master/sms/sms-detail) API.
{% endhint %}
