Supprimer une liste
curl --request DELETE \
--url https://api.wachap.com/v1/contact-groups/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/contact-groups/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/contact-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/contact-groups/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Listes de contacts
Supprimer une liste de contacts
Supprimez définitivement une liste de contacts et tous ses contacts
DELETE
/
contact-groups
/
{id}
Supprimer une liste
curl --request DELETE \
--url https://api.wachap.com/v1/contact-groups/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/contact-groups/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/contact-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/contact-groups/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}Endpoint
/v1/contact-groups/:id
Headers
Bearer token avec votre Secret Key (format:
Bearer sk_...)URL Parameters
L’identifiant de la liste
Exemples de requêtes
curl -X DELETE https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345 \
-H "Authorization: Bearer token"
const response = await fetch('https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer token'
}
});
const data = await response.json();
console.log(data);
Exemple de réponse
{
"success": true,
"deletedContacts": 150
}
Avertissement
Cette action est irréversible !
- La liste sera définitivement supprimée.
- Les campagnes utilisant cette liste conserveront leurs contacts (elles ne seront pas affectées).
Codes d’erreur
| Code | Description |
|---|---|
401 | INVALID_SECRET_KEY - Clé secrète invalide |
404 | Liste non trouvée |
500 | DELETE_CONTACT_GROUP_ERROR - Erreur lors de la suppression |
⌘I
