Publier un statut
curl --request POST \
--url https://api.wachap.com/v1/whatsapp/status/post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"content": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"backgroundColor": "<string>",
"font": 123,
"privacyType": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
content: '<string>',
imageUrl: '<string>',
videoUrl: '<string>',
backgroundColor: '<string>',
font: 123,
privacyType: '<string>'
})
};
fetch('https://api.wachap.com/v1/whatsapp/status/post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
content: '<string>',
imageUrl: '<string>',
videoUrl: '<string>',
backgroundColor: '<string>',
font: 123,
privacyType: '<string>'
})
};
fetch('https://api.wachap.com/v1/whatsapp/status/post', 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/post"
payload = {
"accountId": "<string>",
"content": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"backgroundColor": "<string>",
"font": 123,
"privacyType": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'content' => '<string>',
'imageUrl' => '<string>',
'videoUrl' => '<string>',
'backgroundColor' => '<string>',
'font' => 123,
'privacyType' => '<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/post"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"content\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"videoUrl\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"font\": 123,\n \"privacyType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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
Publier un statut
Publiez un statut (story) WhatsApp avec du texte, une image ou une vidéo.
POST
/
whatsapp
/
status
/
post
Publier un statut
curl --request POST \
--url https://api.wachap.com/v1/whatsapp/status/post \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"accountId": "<string>",
"content": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"backgroundColor": "<string>",
"font": 123,
"privacyType": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
content: '<string>',
imageUrl: '<string>',
videoUrl: '<string>',
backgroundColor: '<string>',
font: 123,
privacyType: '<string>'
})
};
fetch('https://api.wachap.com/v1/whatsapp/status/post', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
accountId: '<string>',
content: '<string>',
imageUrl: '<string>',
videoUrl: '<string>',
backgroundColor: '<string>',
font: 123,
privacyType: '<string>'
})
};
fetch('https://api.wachap.com/v1/whatsapp/status/post', 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/post"
payload = {
"accountId": "<string>",
"content": "<string>",
"imageUrl": "<string>",
"videoUrl": "<string>",
"backgroundColor": "<string>",
"font": 123,
"privacyType": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(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/post",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'accountId' => '<string>',
'content' => '<string>',
'imageUrl' => '<string>',
'videoUrl' => '<string>',
'backgroundColor' => '<string>',
'font' => 123,
'privacyType' => '<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/post"
payload := strings.NewReader("{\n \"accountId\": \"<string>\",\n \"content\": \"<string>\",\n \"imageUrl\": \"<string>\",\n \"videoUrl\": \"<string>\",\n \"backgroundColor\": \"<string>\",\n \"font\": 123,\n \"privacyType\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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))
}Statut Texte Simple
Envoyez un message texte simple dans votre statut.Exemple de requête
curl -X POST https://api.wachap.com/v1/whatsapp/status/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "text",
"content": "Bonne journée à tous ! 😊"
}'
const res = await fetch("https://api.wachap.com/v1/whatsapp/status/post", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
type: "text",
content: "Bonne journée à tous ! 😊"
})
});
const data = await res.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/status/post"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "text",
"content": "Bonne journée à tous ! 😊"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
<?php
$url = 'https://api.wachap.com/v1/whatsapp/status/post';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'type' => 'text',
'content' => 'Bonne journée à tous ! 😊'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Statut Texte avec Style
Personnalisez la couleur de fond et la police.Exemple de requête
curl -X POST https://api.wachap.com/v1/whatsapp/status/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "text",
"content": "Nouveau produit disponible !",
"backgroundColor": "#25D366",
"font": 4,
"privacyType": "contacts"
}'
const res = await fetch("https://api.wachap.com/v1/whatsapp/status/post", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
type: "text",
content: "Nouveau produit disponible !",
backgroundColor: "#25D366",
font: 4,
privacyType: "contacts"
})
});
const data = await res.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/status/post"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "text",
"content": "Nouveau produit disponible !",
"backgroundColor": "#25D366",
"font": 4,
"privacyType": "contacts"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
<?php
$url = 'https://api.wachap.com/v1/whatsapp/status/post';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'type' => 'text',
'content' => 'Nouveau produit disponible !',
'backgroundColor' => '#25D366',
'font' => 4,
'privacyType' => 'contacts'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Statut Image avec Légende
Publiez une image avec une légende optionnelle.Exemple de requête
curl -X POST https://api.wachap.com/v1/whatsapp/status/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "image",
"imageUrl": "https://example.com/promo.jpg",
"caption": "Découvrez notre nouvelle collection ! 🎉"
}'
const res = await fetch("https://api.wachap.com/v1/whatsapp/status/post", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
type: "image",
imageUrl: "https://example.com/promo.jpg",
caption: "Découvrez notre nouvelle collection ! 🎉"
})
});
const data = await res.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/status/post"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "image",
"imageUrl": "https://example.com/promo.jpg",
"caption": "Découvrez notre nouvelle collection ! 🎉"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
<?php
$url = 'https://api.wachap.com/v1/whatsapp/status/post';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'type' => 'image',
'imageUrl' => 'https://example.com/promo.jpg',
'caption' => 'Découvrez notre nouvelle collection ! 🎉'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Statut Vidéo
Publiez une vidéo avec une légende optionnelle.Exemple de requête
curl -X POST https://api.wachap.com/v1/whatsapp/status/post \
-H "Content-Type: application/json" \
-H "Authorization: Bearer token" \
-d '{
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "video",
"videoUrl": "https://example.com/video.mp4",
"caption": "Regardez notre démo produit"
}'
const res = await fetch("https://api.wachap.com/v1/whatsapp/status/post", {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer token'
},
body: JSON.stringify({
accountId: "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
type: "video",
videoUrl: "https://example.com/video.mp4",
caption: "Regardez notre démo produit"
})
});
const data = await res.json();
console.log(data);
import requests
url = "https://api.wachap.com/v1/whatsapp/status/post"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer token"
}
data = {
"accountId": "a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878",
"type": "video",
"videoUrl": "https://example.com/video.mp4",
"caption": "Regardez notre démo produit"
}
response = requests.post(url, json=data, headers=headers)
print(response.json())
<?php
$url = 'https://api.wachap.com/v1/whatsapp/status/post';
$data = [
'accountId' => 'a1233b-a1233b-a1233b-a1233b-a1233bcdjdg9878',
'type' => 'video',
'videoUrl' => 'https://example.com/video.mp4',
'caption' => 'Regardez notre démo produit'
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer token'
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Autorisations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Corps
application/json
Réponse
200
OK
⌘I
