Récupérer vos comptes
curl --request GET \
--url https://api.wachap.com/v1/whatsapp/accounts \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/accounts"
req, _ := http.NewRequest("GET", 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,
"accounts": [
{
"id": "account_abc123",
"phoneNumber": "+33612345678",
"name": "Mon compte principal",
"status": "connected",
"connectedAt": "2025-01-15T10:30:00Z"
},
{
"id": "account_def456",
"phoneNumber": "+33687654321",
"name": "Compte secondaire",
"status": "disconnected",
"connectedAt": null
}
]
}{
"error": "<string>"
}Compte
Récupérer vos comptes
Récupérez tous les comptes WhatsApp connectés à votre instance
GET
/
whatsapp
/
accounts
Récupérer vos comptes
curl --request GET \
--url https://api.wachap.com/v1/whatsapp/accounts \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.wachap.com/v1/whatsapp/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wachap.com/v1/whatsapp/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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/accounts"
req, _ := http.NewRequest("GET", 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,
"accounts": [
{
"id": "account_abc123",
"phoneNumber": "+33612345678",
"name": "Mon compte principal",
"status": "connected",
"connectedAt": "2025-01-15T10:30:00Z"
},
{
"id": "account_def456",
"phoneNumber": "+33687654321",
"name": "Compte secondaire",
"status": "disconnected",
"connectedAt": null
}
]
}{
"error": "<string>"
}Récupérer tous vos comptes
Listez tous les comptes WhatsApp connectés à votre compte WaChap.Endpoint
/v1/whatsapp/accounts
Headers
Bearer token avec votre Secret Key (format:
Bearer sk_...)Exemples de requêtes
curl -X GET https://api.wachap.com/v1/whatsapp/accounts \
-H "Authorization: Bearer token"
const response = await fetch('https://api.wachap.com/v1/whatsapp/accounts', {
method: 'GET',
headers: {
'Authorization': 'Bearer token'
}
});
const data = await response.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/accounts"
headers = {"Authorization": "Bearer token"}
response = requests.get(url, headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wachap.com/v1/whatsapp/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer token"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Réponse
{
"success": true,
"accounts": [
{
"id": "account_abc123",
"phoneNumber": "+33612345678",
"name": "Mon compte principal",
"status": "connected",
"connectedAt": "2025-01-15T10:30:00Z"
},
{
"id": "account_def456",
"phoneNumber": "+33687654321",
"name": "Compte secondaire",
"status": "disconnected",
"connectedAt": null
}
]
}
Status possibles
| Status | Description |
|---|---|
connected | Compte connecté et actif |
disconnected | Compte déconnecté |
connecting | Connexion en cours |
error | Erreur de connexion |
Filtrer par status
curl -X GET "https://api.wachap.com/v1/whatsapp/accounts?status=connected" \
-H "Authorization: Bearer token"
Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de requête
Filtrer par status de connexion
Options disponibles:
connected, disconnected, connecting, error ⌘I
