Webhook Namespace
Send an HTTP POST from your app: Discord, Slack or your own server. It has nothing to do with Atlas sign-in. It is here so you do not need a second HTTP library.
All three calls
// Plaintext Discord message.Atlas::Webhook::SendDiscord( "https://discord.com/api/webhooks/...", "User 'marcus.reyes' just signed in from 192.0.2.1"); // Discord embed with a custom colour. Color is 0xRRGGBB, default 0x3498db.Atlas::Webhook::SendDiscordEmbed( "https://discord.com/api/webhooks/...", "Order Placed", "User 'marcus.reyes' placed order #1234", 0x22c55e); // green // Arbitrary JSON - Slack, custom endpoints, telemetry.Atlas::Webhook::Send( "https://hooks.slack.com/services/...", R"({"text":"hello from atlas"})");SendDiscord
SendDiscordbool SendDiscord(const std::string& webhook_url, const std::string& message);Plaintext Discord webhook message.
Parameters
| Name | Type | Description |
|---|---|---|
webhook_url | string | Discord webhook URL from Server Settings → Integrations → Webhooks. |
message | string | The message body. |
Returns
boolWhether the POST was accepted by the URL.SendDiscordEmbed
SendDiscordEmbedbool SendDiscordEmbed(const std::string& webhook_url, const std::string& title, const std::string& description, int color = 0x3498db);Discord embed with title, description, and an accent colour.
Parameters
| Name | Type | Description |
|---|---|---|
webhook_url | string | Discord webhook URL. |
title | string | Embed title. |
description | string | Embed body. |
coloroptional | int= 0x3498db | 0xRRGGBB. Default is Discord blue. |
Returns
boolWhether the POST was accepted.Send
Sendbool Send(const std::string& url, const std::string& json_payload);POST an arbitrary JSON payload - Slack incoming webhooks, custom endpoints, telemetry.
Parameters
| Name | Type | Description |
|---|---|---|
url | string | Target URL. |
json_payload | string | The JSON body to send. |
Returns
boolWhether the POST was accepted.Was this page useful?