# Stop List

## URL

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

#### **Required Parameters**

<table><thead><tr><th width="142">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.smspartner.fr/dashboard/api">Your API key</a></td></tr></tbody></table>

#### Optional Parameters

<table><thead><tr><th width="142">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>_format</code></td><td><code>json</code> or <code>xml</code></td></tr></tbody></table>

#### Requests

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

```php
?php
 
        // Prepare data for GET request
        $data = 'apiKey=YOUR_API_KEY';
 
        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/stop-sms/list?'.$data);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
 
 
        $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"
    Dim phoneNumber As String = "06XXXXXXXX"
    Dim messageId As Integer = XXX
 
    #check credits
    Dim url As String
    url = base_url & "stop-sms/list" & "?apiKey=" & apiKey
 
    Dim credits As String
    credits = apiRequest("GET", url, Nothing)
 
  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 get_list_stop(self):
		url = URL + "/stop-sms/list?apiKey=" + API_KEY
		r = requests.get(url)
		r_json = r.json()
		if r_json.get("success") == True:
			print(r_json)
			status = True
		else:
			print(r_json)
			status = False
		return status
```

{% endtab %}

{% tab title="cURL" %}

```
curl -H "Content-Type: application/json" -X GET https://api.smspartner.fr/v1/stop-sms/list?apiKey=xxx
```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const https = require('https');

const apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';

const options = {
  hostname: 'api.smspartner.fr',
  port: 443,
  path: `/v1/stop-sms/list?apiKey=${apiKey}`,
  method: 'GET',
};

const req = https.request(options, (res) => {
  console.log(`statusCode: ${res.statusCode}`);

  let rawData = '';
  res.on('data', (chunk) => {
    rawData += chunk;
  });

  res.on('end', () => {
    try {
      const parsedData = JSON.parse(rawData);
      // Process your response here
      console.log(parsedData);
    } catch (e) {
      console.error(e.message);
    }
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.end();
```

{% endtab %}

{% tab title="JAVA" %}

```java
import java.net.HttpURLConnection;
import java.net.URL;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.stream.Collectors;
import org.json.JSONObject;

public class StopSMSList {
    public static void main(String[] args) {
        try {
            String apiKey = "YOUR_API_KEY";
            URL url = new URL("https://api.smspartner.fr/v1/stop-sms/list?apiKey=" + apiKey);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.setRequestProperty("Content-Type", "application/json");
            conn.setRequestProperty("cache-control", "no-cache");

            // Reading API response
            BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
            String response = br.lines().collect(Collectors.joining());

            // Parse JSON response
            JSONObject jsonResponse = new JSONObject(response);

            // Display the JSON response
            System.out.println(jsonResponse.toString(2));

            // Closing HTTP connection
            conn.disconnect();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

{% endtab %}

{% tab title="Swift" %}

```swift
 import SwiftUI

// Structure pour la vue "ListStopSMS"
struct ListStopSMS: View {
    var body: some View {
        // Un bouton qui appelle la fonction ListStopSMS() lorsqu'il est pressé
        Button(action: {
            ListStopSMS()
        }) {
            Text("Check Stop SMS List")
                .font(.system(size: 20))
                .foregroundColor(.white)
                .frame(minWidth: 0, maxWidth: .infinity)
                .padding()
                .background(LinearGradient(gradient: Gradient(colors: [Color.blue, Color.blue.opacity(0.8)]), startPoint: .top, endPoint: .bottom))
                .cornerRadius(10)
                .padding(.horizontal)
        }
    }

    // Fonction pour récupérer la liste des SMS stoppés
    func ListStopSMS() {
        let apiKey = "XXXXXXXXXXXX YOUR API KEY XXXXXXXXXXXXX" // Votre clé API
        let urlString = "https://api.smspartner.fr/v1/stop-sms/list?apiKey=\(apiKey)" // URL pour récupérer la liste des SMS stoppés

        // On vérifie que l'URL est correctement formée
        guard let url = URL(string: urlString) else {
            print("URL invalide")
            return
        }

        // Tâche pour récupérer les données de l'URL
        let task = URLSession.shared.dataTask(with: url) { (data, response, error) in
            // Si une erreur survient, on l'affiche
            if let error = error {
                print("Erreur : \(error)")
            }
            // Sinon, on affiche les données reçues
            else if let data = data {
                let str = String(data: data, encoding: .utf8)
                print("Données reçues :\n\(str ?? "")")
            }
        }

        task.resume() // On lance la tâche
    }
}

// Aperçu de la vue
struct StopSMSList_Previews: PreviewProvider {
    static var previews: some View {
        ListStopSMS()
    }
}
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"io/ioutil"
	"log"
	"net/http"
	"time"
)

func main() {
	// Prepare data for GET request
	apiKey := "YOUR_API_KEY"

	// Create GET request URL
	url := "https://api.smspartner.fr/v1/stop-sms/list?" +
		"apiKey=" + apiKey

	// Create HTTP client
	client := &http.Client{Timeout: 10 * time.Second}

	// Send GET request
	resp, err := client.Get(url)
	if err != nil {
		log.Fatalf("Error sending request: %v", err)
	}
	defer resp.Body.Close()

	// Get response
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("Error reading response body: %v", err)
	}

	// Process your response here
	log.Printf("Response: %s", body)
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
    private static readonly HttpClient client = new HttpClient();

    static async Task Main(string[] args)
    {
        var apiKey = "VOTRE_CLÉ_API";
        var uri = new Uri($"https://api.smspartner.fr/v1/stop-sms/list?apiKey={apiKey}");

        HttpResponseMessage response = await client.GetAsync(uri);

        if (response.IsSuccessStatusCode)
        {
            var result = await response.Content.ReadAsStringAsync();
            Console.WriteLine(result);
        }
        else
        {
            Console.WriteLine("La requête GET a échoué avec le code de statut: " + response.StatusCode);
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### **Response**

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

```json
{
  "success": true,
  "code": 200,
  "nbData": 1,
  "data": [
    {
      "id": 19,
      "phoneNumber": "+33xxxxxxxxx",
      "createdAt": "2015-07-20 10:19:45"
    }
  ]
}
```

{% endcode %}
{% endtab %}

{% tab title="xml" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<result>
    <entry>true</entry>
    <entry>200</entry>
    <entry>3</entry>
    <entry>
        <entry>
            <entry>19</entry>
            <entry>
                <![CDATA[+33xxxxxxxxx]]>
            </entry>
            <entry>
                <![CDATA[2015-07-20 10:19:45]]>
            </entry>
        </entry>
    </entry>
</result>
```

{% endtab %}
{% endtabs %}

#### Errors

{% 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><![CDATA[Invalid API key]]></entry>
</result>
```

{% endtab %}
{% endtabs %}

**Error Codes**

| Response Code | Message             |
| ------------- | ------------------- |
| 1             | API key is required |
| 10            | Invalid API key     |
| 200           | Success             |


---

# 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/replies-opt-outs-management/stop-list.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.
