All status methods are accessed via client.statuses.<method>().
WhatsApp Statuses (Stories) are temporary 24-hour media posts visible to your contacts.
Purpose: Post text-only status.
Signature:
Response Statuses::sendTextStatus(const nlohmann::json& status);Required Parameters:
text(string): Status text
Optional Parameters:
backgroundColor(string): Hex color codefont(integer): Font style
Response:
{
"idMessage": "3EB0C67FA8C3DAF78C40D0C3"
}Example:
nlohmann::json status = {
{"text", "Working on new features!"},
{"backgroundColor", "#FF5733"}
};
client.statuses.sendTextStatus(status);Official Docs: https://green-api.com/en/docs/api/statuses/SendTextStatus/
Purpose: Post audio/voice status.
Signature:
Response Statuses::sendVoiceStatus(const nlohmann::json& status);Required Parameters:
urlFile(string): Audio file URL
Optional Parameters:
caption(string): Optional caption
Example:
nlohmann::json status = {
{"urlFile", "https://example.com/audio.mp3"}
};
client.statuses.sendVoiceStatus(status);Official Docs: https://green-api.com/en/docs/api/statuses/SendVoiceStatus/
Purpose: Post image or video status.
Signature:
Response Statuses::sendMediaStatus(const nlohmann::json& status);Required Parameters:
urlFile(string): Image or video URL
Optional Parameters:
caption(string): Status caption
Supported Formats:
- Images:
.jpg,.png,.webp - Videos:
.mp4,.mov
Example:
nlohmann::json status = {
{"urlFile", "https://example.com/photo.jpg"},
{"caption", "Beautiful sunset! 🌅"}
};
client.statuses.sendMediaStatus(status);Official Docs: https://green-api.com/en/docs/api/statuses/SendMediaStatus/
Purpose: Delete published status.
Signature:
Response Statuses::deleteStatus(const nlohmann::json& status);Required Parameters:
idMessage(string): Status message ID
Response:
{
"result": true
}Example:
nlohmann::json deleteReq = {
{"idMessage", "3EB0C67FA8C3DAF78C40D0C3"}
};
client.statuses.deleteStatus(deleteReq);Official Docs: https://green-api.com/en/docs/api/statuses/DeleteStatus/
Purpose: Get views/interactions for published status.
Signature:
Response Statuses::getStatusStatistic(std::string idMessage);Parameters:
idMessage(string): Status message ID
Response:
{
"sent": 150,
"delivered": 148,
"read": 125
}Example:
Response resp = client.statuses.getStatusStatistic("3EB0C67FA8C3DAF78C40D0C3");
if (resp.success) {
int read = resp.body["read"];
int sent = resp.body["sent"];
std::cout << "Status read by " << read << "/" << sent << std::endl;
}Official Docs: https://green-api.com/en/docs/api/statuses/GetStatusStatistic/
Purpose: Get statuses from contacts (default: 24 hours).
Signature:
Response Statuses::getIncomingStatuses(const unsigned int minutes = 1440);Parameters:
minutes(integer, default 1440): Time window in minutes
Response:
{
"statuses": [
{
"idMessage": "...",
"timestamp": 1234567890,
"senderName": "John",
"text": "Hello everyone!",
"media": {
"type": "image",
"url": "https://..."
}
}
]
}Example:
Response resp = client.statuses.getIncomingStatuses();
for (auto& status : resp.body["statuses"]) {
std::cout << status["senderName"] << ": " << status["text"] << std::endl;
}Official Docs: https://green-api.com/en/docs/api/statuses/GetIncomingStatuses/
Purpose: Get statuses posted by this account.
Signature:
Response Statuses::getOutgoingStatuses(const unsigned int minutes = 1440);Parameters:
minutes(integer, default 1440): Time window in minutes
Example:
// Last 24 hours
Response resp = client.statuses.getOutgoingStatuses();
// Last 12 hours
Response resp = client.statuses.getOutgoingStatuses(720);Official Docs: https://green-api.com/en/docs/api/statuses/GetOutgoingStatuses/
Last Updated: 2024