Supprimer un contact
curl --request DELETE \
--url https://api.wachap.com/v1/contact-groups/{id}/contacts/{contactIndex} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}/contacts/{contactIndex}', 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}/contacts/{contactIndex}', 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}/contacts/{contactIndex}"
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}/contacts/{contactIndex}",
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}/contacts/{contactIndex}"
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 un contact
Supprimez un contact spécifique d’une liste liste de contacts
DELETE
/
contact-groups
/
{id}
/
contacts
/
{contactIndex}
Supprimer un contact
curl --request DELETE \
--url https://api.wachap.com/v1/contact-groups/{id}/contacts/{contactIndex} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/contact-groups/{id}/contacts/{contactIndex}', 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}/contacts/{contactIndex}', 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}/contacts/{contactIndex}"
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}/contacts/{contactIndex}",
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}/contacts/{contactIndex}"
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
Headers
string
requis
Bearer token avec votre Secret Key (format:
Bearer sk_...)URL Parameters
string
requis
L’identifiant de la liste
number
requis
L’index du contact à supprimer
Exemples de requêtes
curl -X DELETE https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345/contacts/5 \
-H "Authorization: Bearer token"
const response = await fetch('https://api.wachap.com/v1/contact-groups/65f1234567890abcdef12345/contacts/5', {
method: 'DELETE',
headers: {
'Authorization': 'Bearer token'
}
});
const data = await response.json();
console.log(data);
Exemple de réponse
{
"success": true,
"deletedColumns": 5,
"contactIndex": 5
}
Note importante
- Attention : Cette action est irréversible.
- Tous les champs personnalisés du contact seront supprimés.
- L’index du contact supprimé ne peut pas être réutilisé.
- Les autres contacts conservent leurs index originaux.
Codes d’erreur
| Code | Description |
|---|---|
401 | INVALID_SECRET_KEY - Clé secrète invalide |
403 | FORBIDDEN - Vous n’êtes pas le propriétaire de cette liste |
404 | CONTACT_NOT_FOUND - Contact non trouvé à cet index |
500 | DELETE_CONTACT_ERROR - Erreur lors de la suppression |
