Modifier une étiquette WhatsApp
curl --request PATCH \
--url https://api.wachap.com/v1/whatsapp/labels/{labelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"name": "<string>",
"color": 123
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', name: '<string>', color: 123})
};
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: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', name: '<string>', color: 123})
};
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}"
payload = {
"accountId": "<string>",
"name": "<string>",
"color": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, 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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'name' => '<string>',
'color' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/labels/{labelId}"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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>"
}
}Étiquettes WhatsApp
Modifier une étiquette
Modifiez le nom ou la couleur d’une étiquette WhatsApp
PATCH
/
whatsapp
/
labels
/
{labelId}
Modifier une étiquette WhatsApp
curl --request PATCH \
--url https://api.wachap.com/v1/whatsapp/labels/{labelId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"name": "<string>",
"color": 123
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', name: '<string>', color: 123})
};
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: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>', name: '<string>', color: 123})
};
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}"
payload = {
"accountId": "<string>",
"name": "<string>",
"color": 123
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, 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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'name' => '<string>',
'color' => 123
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wachap.com/v1/whatsapp/labels/{labelId}"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"name\": \"<string>\",\n \"color\": 123\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
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>"
}
}Endpoint
/v1/whatsapp/labels/:labelId
Paramètres
Identifiant de l’étiquette à modifier.
Identifiant du compte WhatsApp.
Nouveau nom. Le nom existant est conservé si ce champ est omis.
Nouvelle couleur. La couleur existante est conservée si ce champ est omis.
Exemple
curl -X PATCH https://api.wachap.com/v1/whatsapp/labels/label_vip \
-H "Authorization: Bearer token" \
-H "Content-Type: application/json" \
-d '{
"accountId": "account_123",
"name": "Clients VIP",
"color": 2
}'
404 LABEL_NOT_FOUND.Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
⌘I
