Définir confidentialité statuts
curl --request PUT \
--url https://api.wachap.com/v1/whatsapp/status/privacy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/status/privacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/status/privacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/status/privacy"
payload = { "accountId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/status/privacy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>'
]),
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/status/privacy"
payload := strings.NewReader("{\n \"accountId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}Statuts
Définir confidentialité
Modifier la confidentialité des statuts WhatsApp
PUT
/
whatsapp
/
status
/
privacy
Définir confidentialité statuts
curl --request PUT \
--url https://api.wachap.com/v1/whatsapp/status/privacy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/status/privacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({accountId: '<string>'})
};
fetch('https://api.wachap.com/v1/whatsapp/status/privacy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/status/privacy"
payload = { "accountId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/status/privacy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>'
]),
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/status/privacy"
payload := strings.NewReader("{\n \"accountId\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", 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))
}Définir la confidentialité des statuts
Modifiez le mode de confidentialité pour vos statuts WhatsApp.Endpoint
Headers
string
requis
Bearer token avec votre Secret Key (format:
Bearer sk_...)Body Parameters
string
requis
L’identifiant du compte WhatsApp
string
requis
Mode de confidentialité:
all, contacts, contacts_except, noneExemples de requêtes
curl -X PUT https://api.wachap.com/v1/whatsapp/status/privacy \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"privacyType": "contacts"
}'
Exemple de réponse
{
"success": true,
"message": "Confidentialité des statuts mise à jour",
"newPrivacyMode": "contacts"
}
Codes d’erreur
| Code | Description |
|---|---|
400 | INVADLID_PRIVACY_TYPE - Type invalide |
401 | INVALID_SECRET_KEY - Clé secrète invalide |
404 | ACCOUNT_NOT_FOUND - Compte WhatsApp non trouvé |
