POST a HTTPS request to https://alertzy.app/send with the following parameters:
• accountKey (required) - your Account Key (can be found in Alertzy app under Account tab)
• title (either title or message is required) - the title of your push notification
• message (either title or message is required) - the body of your push notification
Optional parameters that can be included:
• priority - integer value representing priority [0 = Normal (default), 1 = High, 2 = Critical]. Set priority for your notification to distinguish important notifications. This highlights the notification in different colours in the app and allows you to filter notifications by priority.
• group - text name of group. This allows you to group messages, similarly to placing notifications in different folders. In app your can filter notifications to only see the ones in particular group.
• image - a web URL link pointing to an image (must start with "http://"). This allows to add images to your notifications. Great for security camera snapshots or if you want to add any other image to the notification.
• link - any web URL link (must start with "http://"). This will add a clickable link to your notification that will open in your device's browser.
• buttons - actionable buttons. Sent as JSON array of button objects, for example to add a button send: [{"text":"Google","link":"http://google.com","color":"green"}]
This allows you to add one or many buttons to perform actions by calling relevant web URLs or iOS shortcuts. For example, a notification is received alerting your Dev Ops that a person from overseas has accessed your account and two buttons are provided to allow or block the particular IP: "Someone from North Korea just tried to access your account. What do you want to do?", and two buttons provided: "Block IP" and "Allow IP". Clicking "Block IP" button results in a call-back to a URL (with a token for identification) and can create an action without further intervention from the user.
A JSON array containing button objects must be provided here. Each button object should consist of three key/value pairs:
• text: text label for the button (e.g. "Block IP")
• link: a web URL link that will be opened in browser when button is clicked (must start with "http://") or iOS shortcuts link (must start with "shortcuts://run-shortcut")
• color: name of the color for the button. Color options are: blue green orange red lightblue grey black
Example below demonstrates JSON containing two actionable buttons:
[{"text":"Google","link":"http://google.com","color":"green"},{"text":"Yahoo","link":"http://yahoo.com","color":"orange"}]
You are able to send a single Alertzy message to multiple accounts at once. This is handy in cases where a group of people need to receive same notification and want to be able to discuss this as a group. Imagine a server going down and three technicians receive Alertzy notification. This will allow them to discuss the issue and leave comments as the issue gets resolved.
To achieve this, provide multiple Account Keys as a single string concatenated with underscores.
e.g. you want to send to two Account Keys at same time, to "111222333aaaccc" and to "999888777zzzxxx". Then you Account Key parameter will look like "111222333aaaccc_999888777zzzxxx".
If API request was valid, you will receive a JSON object containing a response status as success and a sentTo parameter containing an array of Account Keys to which the Alertzy was sent.
{"response":"success","sentTo":["111222333aaaccc"]}
If any input was invalid, you will receive a JSON object containing a response status as fail, and an error parameter containing an array of Account Keys and associated error message detailing the issue.
{"response":"fail","sentTo":[],"error":{"999888777zzzxxx":"Invalid Account Key"}}
When sending to multiple Account Keys at once, if some input was valid while other was invalid, you will receive a JSON object containing a response status as mixed, a sentTo parameter containing an array of Account Keys to which the Alertzy was sent and an error parameter containing an array of Account Keys and associated error message detailing the issue.
{"response":"mixed","sentTo":["111222333aaaccc"],"error":{"999888777zzzxxx":"Invalid Account Key"}}
Messages are currently limited to 2,000 4-byte UTF-8 characters, with a title of up to 255 characters.
You are allowed to send 100 push notification messages each day. Please contact us if you need to send higher number of notifications.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://alertzy.app/send");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
"accountKey" => "111222333aaaccc",
"title" => "title of your alert",
"message" => "alert message here",
"group" => "test folder",
"buttons" => json_encode(array(array("text"=>"Google", "link"=>"http://google.com","color"=>"success")))
)
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
print_r($response); //display alertzy response while developing
curl_close ($ch);
require "net/https"
url = URI.parse("https://alertzy.app/send")
req = Net::HTTP::Post.new(url.path)
req.set_form_data({
:accountKey => "111222333aaaccc",
:title => "title of your alert",
:message => "alert message here",
:group => "test folder"
})
res = Net::HTTP.new(url.host, url.port)
res.use_ssl = true
res.verify_mode = OpenSSL::SSL::VERIFY_PEER
res.start {|http| http.request(req) }
curl -s \
--form-string "accountKey=111222333aaaccc" \
--form-string "title=title of your alert" \
--form-string "message=alert message here" \
--form-string "group=test folder" \
--form-string 'buttons=[{"text":"Google", "link":"http://google.com","color":"success"}]' \
https://alertzy.app/send
use LWP::UserAgent;
use Mozilla::CA;
LWP::UserAgent->new()->post(
"https://alertzy.app/send", [
"accountKey" => "111222333aaaccc",
"title" => "title of your alert",
"message" => "alert message here",
"group" => "test folder"
]);