# Bulk Status

## URL

<mark style="color:red;">`GET`</mark> `https://api.smspartner.fr/v1/multi-status`

{% hint style="info" %}
Delivery reports are usually received within a few seconds after sending the SMS. However, depending on the operators and our platform’s traffic, this delay may extend up to 48 hours.
{% endhint %}

#### **Required Parameters**

| Name             | Value                                                                                                                                                                                                                                                                                                                                                                |
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apiKey`         | [Your API key](https://my.smspartner.fr/dashboard/api)                                                                                                                                                                                                                                                                                                               |
| `SMSStatut_List` | <p>A list of objects with:<br>- <code>phoneNumber</code>: Recipient phone numbers, up to 500 per request (must be in international format: +336xxxxxxxx)<br>- <code>messageId</code>: ID of the sent message. Found in the <a href="https://github.com/lucassaillot/docpartner-en/blob/main/api/sms-partner/send-sms/single-send.md#response">send response</a>.</p> |

#### **Optional Parameters**

| Name      | Value           |
| --------- | --------------- |
| `_format` | `json` or `xml` |

#### Requests

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

```php
<?php
        // Prepare data for POST request
        $fields = array(
            'apiKey'=> 'YOUR API KEY',
            'SMSStatut_List'=>>array(
                array('phoneNumber'=>'+336xxxxxxxx','messageId'=>messageId1),
                array('phoneNumber'=>'+336xxxxxxxx','messageId'=>messageId2)
             )
        );
 
 
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/multi-status');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($fields));
 
        $result = curl_exec($curl);
        curl_close($curl);
 
        // Process your response here
        echo $result;
?>
```

{% endtab %}

{% tab title="VB.net" %}

```vbnet
Imports System.IO
Imports System.Net
 
Module Module1
 
  Sub Main()
 
    Dim base_url As String = "http://api.smspartner.fr/v1/"
    Dim apiKey As String = "VOTRE_APIKEY"
 
    #send sms
    url = base_url & "multi-status"
    #note : utiliser une librairie JSON en production, par exemple :
    #https//www.nuget.org/packages/Newtonsoft.Json/
    Dim parameters As String = String.Format(
        "{{""apiKey"":""{0}"",""SMSStatut_List"":""{1}""}}",
        apiKey,
        {{ ""phoneNumber"":"06xxxxxxx1",""messageId"":"msgId1"},{ ""phoneNumber"":"06xxxxxxx2",""message"":"msgId2"}}
        )
    Console.Write(parameters)
    apiRequest("POST", url, parameters)
 
  End Sub
 
  Function apiRequest(method As String, url As String, parameters As String) As String
 
    Dim request As HttpWebRequest
    request = WebRequest.Create(url)
    request.Method = method
    request.Timeout = 10000   # timeout in ms
    request.ContentType = "application/json; charset=utf-8"
    request.ContentLength = 0
 
    #set POST data
    If Not String.IsNullOrEmpty(parameters) Then
      request.ContentLength = parameters.Length
      Using reqStream As StreamWriter = New StreamWriter(request.GetRequestStream())
        reqStream.Write(parameters)
      End Using
    End If
 
    #get response
    Dim returnValue As String = Nothing
    Using response As HttpWebResponse = request.GetResponse()
      If response.StatusCode = HttpStatusCode.OK Then
        Using resStream = response.GetResponseStream()
          If resStream IsNot Nothing Then
            Using reader As New StreamReader(resStream)
              returnValue = reader.ReadToEnd()
            End Using
          End If
        End Using
      End If
    End Using
    apiRequest = returnValue
 
  End Function
 
End Module
```

{% endtab %}

{% tab title="Python" %}

```python
# std
import logging
import json
from collections import OrderedDict
 
# 3p
import requests
 
API_KEY = "MY API KEY"
URL = "https://api.smspartner.fr/v1"
 
class SMSPartner():
    def send_sms(self,phone_number, phone_number2, msgId1, msgId2):
		print(phone_number)
 
 
		data = {"apiKey":APIKEY,"SMSStatut_List":[{"phoneNumber":phone_number,"messageId":msgId1},{"phoneNumber":phone_number2,"messageId":msgId2}]}
 
		url = URL + "/multi-status"
		r = requests.post(url, data=json.dumps(data), verify=False)
 
		r_json = r.json()
		if r_json.get("success") == True:
			print(r_json)
			status = True
		else:
			print("SMS msg {} not delivered to {}".format(msg, phone_numbers))
			status = False
		return status
```

{% endtab %}

{% tab title="cURL" %}

```
curl -X POST https://api.smspartner.fr/v1/multi-status -H "Content-Type: application/json" -d '{"apiKey": "Votre clé API","SMSStatut_List": [{"phoneNumber": "0619922264", "messageId": 199897},{"phoneNumber": "06xxxxxxx2", "messageId": 1000},{"phoneNumber": "06xxxxxxx1", "messageId": 1222}]}'
```

{% endtab %}
{% endtabs %}

#### **Response**

{% tabs %}
{% tab title="json" %}
{% code fullWidth="true" %}

```json
{
    "success": true,
    "code": 200,
    "StatutResponse_List": [
        {
            "success": true,
            "code": 200,
            "phoneNumber": "+33699999993",
            "messageId": 111111,
            "status": "Delivered",
            "date": "1517934416",
            "stopSms": "0",
            "isSpam": "0"
        },
        {
            "success": false,
            "code": 4,
            "phoneNumber": "+33699999992",
            "messageId": 1000,
            "status": "Number not found"
        },
        {
            "success": false,
            "code": 4,
            "phoneNumber": "+33699999991",
            "messageId": 1222,
            "status": "Number not found"
        }
    ]
}
```

{% endcode %}
{% endtab %}

{% tab title="xml" %}

```xml
<?xml version='1.0' encoding='UTF-8'?>
<result>
    <entry>true</entry>
    <entry>200</entry>
    <entry>
        <entry>
            <entry>true</entry>
            <entry>200</entry>
            <entry><![CDATA[+33619922264]]></entry>
            <entry>1226613</entry>
            <entry><![CDATA[Delivered]]></entry>
            <entry><![CDATA[1517934416]]></entry>
            <entry><![CDATA[0]]></entry>
            <entry><![CDATA[0]]></entry>
        </entry>
        <entry>
            <entry>false</entry>
            <entry>4</entry>
            <entry><![CDATA[+33699999992]]></entry>
            <entry>1000</entry>
            <entry><![CDATA[Number not found]]></entry>
        </entry>
        <entry>
            <entry>false</entry>
            <entry>4</entry>
            <entry><![CDATA[+33699999991]]></entry>
            <entry>1222</entry>
            <entry><![CDATA[Number not found]]></entry>
        </entry>
    </entry>
</result>
```

{% endtab %}
{% endtabs %}

* **Delivered**: The message was successfully delivered to the recipient’s device or platform.
* **Not delivered**: The message could not be delivered. Possible reasons include an invalid phone number or operator issues.
* **Waiting**: The message is still in the process of being delivered and has not yet been confirmed as delivered or failed.

#### Erreurs

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

```json
{
    "success": false,
    "code": 10,
    "message": "Invalid API key"
}
```

{% endtab %}

{% tab title="xml" %}

```xml
<?xml version='1.0' encoding='UTF-8'?>
<result>
    <entry>false</entry>
    <entry>10</entry>
    <entry>Invalid API key</entry>
</result>
```

{% endtab %}
{% endtabs %}

**Error Codes**

| Response Code | Description         |
| ------------- | ------------------- |
| 1             | API key is required |
| 4             | Message not found   |
| 10            | Invalid API key     |


---

# 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://www.docpartner.dev/en/api/sms-partner/status-and-statistics/bulk-status.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.
