Set WhatsApp Video Status
This endpoint will let you set an ephemeral video as the status of your WhatsApp account using a publicly accessible video URL.
This status will show up as an update similar to Instagram statuses.
Parameters
These parameters should be sent as JSON payload in the request body.
| Field | Description | Example values |
|---|---|---|
video_url | A publicly accessible URL pointing to the video file | https://d1qqh7cleddlua.cloudfront.net/video/2chat-whatsapp-virtual-number.mp4 |
Invocation
Make a POST request to https://api.p.2chat.io/open/whatsapp/set-video-status/<number> where <number> is the phone number that you have connected to 2Chat.
- cURL
- Python
- JavaScript
- PHP
curl --location --request POST 'https://api.p.2chat.io/open/whatsapp/set-video-status/+5491124837650' \
--header 'X-User-API-Key: your_api_key_here' \
--header 'Content-Type: application/json' \
--data-raw '{
"video_url": "https://d1qqh7cleddlua.cloudfront.net/video/2chat-whatsapp-virtual-number.mp4"
}'
import requests
import json
url = "https://api.p.2chat.io/open/whatsapp/set-video-status/+5491124837650"
payload = json.dumps({
"video_url": "https://d1qqh7cleddlua.cloudfront.net/video/2chat-whatsapp-virtual-number.mp4"
})
headers = {
'X-User-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
var axios = require('axios');
var data = JSON.stringify({
"video_url": "https://d1qqh7cleddlua.cloudfront.net/video/2chat-whatsapp-virtual-number.mp4"
});
var config = {
method: 'post',
url: 'https://api.p.2chat.io/open/whatsapp/set-video-status/+5491124837650',
headers: {
'X-User-API-Key': 'your_api_key_here',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/whatsapp/set-video-status/+5491124837650',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"video_url": "https://d1qqh7cleddlua.cloudfront.net/video/2chat-whatsapp-virtual-number.mp4"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
The API will return whether it succeded or not to queue the request for processing
{
"success": true,
}