Aero

Please wait...

EZAlert.me code samples

First thing you should do (after subscribing to EZAlert.me) is to get your API key. Just go in your channel configuration page, click on "Show API keys" button and copy the key. API key is in the format YY-YYYYYYYYYYYY.
Once you have your EZAlert.me channel API key, you are ready to send alerts.

Here follow a few code samples for various languages.
In each sample we used a dummy API key YY-YYYYYYYYYYYY and the same altert text "test alert".


Unix command line - using curl (GET method)


curl 'https://ezalert.me/v1/sendAlert?apikey=YY-YYYYYYYYYYYY&text=test+alert'

Unix command line - using curl (POST method)


curl -X POST 'https://ezalert.me/v1/sendAlert' --data-urlencode 'apikey=YY-YYYYYYYYYYYY' --data-urlencode 'text=test alert'

Unix command line - using wget


wget -qO - 'https://ezalert.me/v1/sendAlert?apikey=YY-YYYYYYYYYYYY&text=test+alert'

Unix command line - using fetch (for BSD systems)


fetch -o - 'https://ezalert.me/v1/sendAlert?apikey=YY-YYYYYYYYYYYY&text=test+alert'

PHP - using file_get_contents()


<?php
$alert="test alert";
$apikey='YY-YYYYYYYYYYYY';
$rc=file_get_contents('https://ezalert.me/v1/sendAlert?apikey='.urlencode($apikey).'&text='.urlencode($alert));
echo "API reply: $rc\n";
?>

Python - using requests module


import requests
params=(('apikey','YY-YYYYYYYYYYYY'), ('text','test alert'))
rc=requests.get('https://ezalert.me/v1/sendAlert', params)
print(rc.text)

For more samples and details please checkout EZAlert.me repo on GitHub.