Supprimer une étiquette WhatsApp
curl --request DELETE \
--url https://api.wachap.com/v1/whatsapp/labels/{labelId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/labels/{labelId}', 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/whatsapp/labels/{labelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/labels/{labelId}"
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/whatsapp/labels/{labelId}",
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/whatsapp/labels/{labelId}"
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))
}{
"success": true,
"label": {
"id": "<string>",
"userId": "<string>",
"accountId": "<string>",
"labelId": "<string>",
"name": "<string>",
"color": 123,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
},
"changed": true
}Étiquettes WhatsApp
Supprimer une étiquette
Supprimez une étiquette WhatsApp
DELETE
/
whatsapp
/
labels
/
{labelId}
Supprimer une étiquette WhatsApp
curl --request DELETE \
--url https://api.wachap.com/v1/whatsapp/labels/{labelId} \
--header 'Authorization: Bearer <token>'const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/labels/{labelId}', 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/whatsapp/labels/{labelId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/labels/{labelId}"
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/whatsapp/labels/{labelId}",
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/whatsapp/labels/{labelId}"
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))
}{
"success": true,
"label": {
"id": "<string>",
"userId": "<string>",
"accountId": "<string>",
"labelId": "<string>",
"name": "<string>",
"color": 123,
"deleted": true,
"createdAt": "<string>",
"updatedAt": "<string>",
"syncedAt": "<string>",
"fromSync": true,
"source": "<string>"
},
"changed": true
}Endpoint
Paramètres
string
requis
Identifiant de l’étiquette à supprimer.
string
requis
Identifiant du compte WhatsApp.
Exemple
curl -X DELETE "https://api.wachap.com/v1/whatsapp/labels/label_vip?accountId=account_123" \
-H "Authorization: Bearer token"
Réponse
{
"success": true,
"label": {
"accountId": "account_123",
"labelId": "label_vip",
"name": "VIP",
"color": 1,
"deleted": true,
"source": "api"
},
"changed": true
}
404 LABEL_NOT_FOUND.Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
