HowTo
How to send notifications with ZBXalert
1. Register a sender account
Registering an account can easily be made over the API. To register just send the following request containing your own data with any desired tool via HTTP Post to https://api.zbxalert.com/v1/user
{ "email": "demo@zbxalert.com", "firstname": "First name", "lastname": "Last name", "password": "1SecurePassword!" }
The answer you will receive if you registration was successful contains the status of the request as well as your AccountID and your API token:
{ "status": "ok", "statusDetail": "User successfully created", "requestId": "2b1a6bf0-465b-11e8-a691-55a1dd521900", "user": { "email": "demo@zbxalert.com", "firstname": "First name", "lastname": "Last name", "accountId": "21342c36-337a-5699-a1z3-483dd4fj763c", "token": "kytffZ4patSkaGgSkmylf1BnHAkSKP2cDsauvrSA6Oad1dR1WEcwpVFPXJ8rgOOI7TXvjAeW7NrHFZ61cfDe1MI5y9TtBAHCJl5EkA4Mc1d6GbsuXrEdDrcUqJolABd2" } }

2. Confirm email address
A validation mail has been sent to the registered email address. With opening the included link the email address is confirmed.
3. Find AccountIDs of the receiver(s)
To be able to send a notification/alert to a recipient you need his AccountID. The AccountID can be found within the App under settings-recipient information and has to be communicated to the sender.
The public key of the recipient can also be found here. This public key is necessary for some encryption tools.
4. Send notifications
The sending of the notifications/alerts is also operated over the API. To send a notification/alert a HTTP Post Request has to be sent to https://api.zbxalert.com/v1/message In this request you will have to replace the containing data with your data as follows:
Header: X-API-KEY
{ "senderToken": "2KvcX7yfpQfrH8HUvKJVox5ZcCrcCaO5gIV63u9x7EYA4pAu7jyCqRAA4QEIIWjn", "recipient": "52ababa5-9ca9-4a0a-8db7-b0de5ea960be", "identifier": "km1", "eventid": 20006, "status": 1, "severity": 2, "title": "Free disk space is less than 15% on volume /srv", "text": "Item values:\n\n1. Free disk space on /srv (percentage) (grey031 (Customer 12):vfs.fs.size[/export,pfree]): 2.75 %\n\n2. Free disk space on /export (percentage) (grey031 (Customer 12):vfs.fs.size[/export,pfree]): 2.75 %\n\n3. *UNKNOWN* (*UNKNOWN*:*UNKNOWN*): *UNKNOWN*\n\nTrigger Description:\nThe free disk space for this volume is lower than 3% for at least 10 minutes.", "hostname": "grey031", "hostgroup": "webserver", "hosttype": "linux" }
The answer you will receive contains the status of the request as well as the ID of the outgoing message:
{ "status": "ok", "statusDetail": "Message successfully sent", "requestId": "90db711a-4fb7-11e8-814a-39667866b640", "messageId": "-LBfxwhKDXm0gYij29Jy" }
Definition of parameters
# | Parameter | Definition | Required |
---|---|---|---|
1 | senderToken | API token of the sender. Shown while registering the user | yes |
2 | recipient | AccountID of the receiver | yes |
3 | identifier | A kind of instanceID of the sender. With this parameter an EventID can be assigned to an instance. Required for more than one monitoring system, for example, that sent from one and the same sender account | yes |
4 | eventid | Unique ID of the event from the monitoring system | yes |
5 | status | Status of the event. 0= ok; 1 = problem | yes |
6 | severity | Classification of events: 0=not classified; 1=information, 2=warning; 3=average; 4=high; 5=disaster | yes |
7 | title | Title of the event | yes |
8 | text | Notification text of the event | yes |
9 | hostname | Hostname of the triggered system for this event | yes |
10 | hostgroup | Host group of the triggered system for this event | yes |
11 | hosttype | Hosttype of the triggered system. For example Linux, Windows or MacOS | yes |