Übersicht der API Kommandos

Account

Folgende API Kommandos dienen der Account Verwaltung:

Account anlegen

URL: https://api.zbxalert.com/v1/user
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
	"email": "demo@zbxalert.com",
	"firstname": "First name",
	"lastname": "Last name",
	"password": "1SecurePassword!"
}
{
    "status": "ok",
    "statusDetail": "User successfully created",
    "requestId": "2b1a6bf0-465b-11e8-a691-55a1dd521900",
    "user": {
        "email": "demo@zbxalert.com",
        "firstname": "First name",
        "lastname": "Last name",
        "accountId": "52342c3e-337a-5699-a9a3-483dd4f7763c",
        "token": "kytfDZ4patSkaGFSkmylf1BnHAkSKP2cDsauv9SA6OadvdR1WEcwpVFPXJ8rgOOI7TXvjAeW7NrHFZ61c2De1MI5y9TtBAHCJl5EiA4Mc1dQGbsuXrEdDrcUqJolABdp"
    }
}

Account (Email) Validierung

URL: https://api.zbxalert.com/v1/user/confirm
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
	"email": "demo@Zbxalert.Com",
	"confirm_code": "WO9D7Y1D6TKZ8WVA9CX9HFCI4OUQZOGW"
}
{
    "status": "ok",
    "statusDetail": "Email successfully confirmed",
    "requestId": "56a17ba2-4f88-11e8-9f54-27ba3a26d248"
}

Account Validierungs E-Mail erneut senden

URL: https://api.zbxalert.com/v1/user/resend
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
	"email": "demo@zbxalert.com"
}
{
    "status": "ok",
    "statusDetail": "Confirmation code successfully sent",
    "requestId": "56a17ba2-4f88-11e8-9f54-27ba3a26d248"
}

Account löschen

URL: https://api.zbxalert.com/
Method: DELETE
Header: Content-Type: application/json
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

- no request data -

{
    "status": "ok",
    "statusDetail": "User successfully deleted",
    "requestId": "6b676478-4e23-11e8-b198-ad5edb5bf6b5"
}

Login

URL: https://api.zbxalert.com/v1/user/session
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
  "email": "demo@zbxalert.com",
  "password": "1SecurePassword!"
}
{
    "status": "ok",
    "statusDetail": "User authenticated",
    "requestId": "be2d42c8-4e1f-11e8-a8b4-7d427478a8b0",
    "session": {
        "session_token": "eyJ0e1AiOiJKV1QlLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4NWRkNmI5YmZjZWJjMDIzM2MxYzJmYTZmN2NiYWE3ZCIsInlzcyI6Imh0dHBzOi8vbGIwMS5tZXNzbmVyLmlvL2FwaS92Mi91c2VyL3Nlc3Npb24iLCJpYXQiOjE1MjUyNzU4ODgsImV4cCI6MTUyNTI3OTQ4OCwibmJmIjoxNTI1Mjc1ODg4LCJqdGkiOiJEaFZyYjdXTGlMdzMxNFAxIiwidXNlcl9pZCI6NDIsImZvcmV2ZXIiOmZhbHNlfQ.fL0Q7ZNorGYheHQopuLHenWa0M0chIbNvS1zTAFcyt2",
        "device_token": "eyJbbGciOiJSUsI1NiIsInR5cCI6IkpXVCJ9.eyJjbGFpbXMiOmsiZW1haWxWZXJpZmllZCI6dHJ1ZSwiZGlzYWJsZWQiOmZhbHNlLCJwcmVtaXVtQWNjb3VudCI6ZmFsc2UsImlzX2FjY291bnRfbWFuYWdlciI6ZmFsc2UsImlzX21hbmFnZWRfYWNjb3VudCI6ZmFsc2UsImFjY291bnRtYW5hZ3VyX2lkIjowfSwidWlkIjoiYzBjNWY0MzEtZmU3OS01MjY4LTllODktYjQwYmNmYTJmZmY0IiwiaWF0IjoxNTI1Mjc1ODg5LCJleHAiOjE1MjUyNzk0ODksImF1ZCI6Imh0dHBzOi8vaWRlbnRpdHl0b29sa2l0Lmdvb2dsZWFwaXMuY29tL2dvb2dsZS5pZGVudGl0eS5pZGVudGl0eXRvb2xraXQudjEuSWRlbnRpdHlUb29sa2l0IiwiaXNzIjoiZmlyZWJhc2UtYWRtaW5zZGstOXl5bHhAemJ4YWxlcnQtZGI1ZjQuaWFtLmdzZXJ2aWNlYWNjb3VudC5jb20iLCJzdWIiOiJmaXJlYmFzZS1hZG1pbnNkay05eXlseEB6YnhhbGVydC1kYjVmNC5pYW0uZ3NlcnZpY2VhY2NvdW50LmNvbSJ9.NJhsTRq0TlTdpF6Su1O3MOQKm0LD0SrkwmL_PzUt8I9E-MQ2S0A09YEgCDStdqMaBdC_xZ-QRRyscZKN1yMxbB2nwb7xIXlqGHJoaMpHMw5tpsScdielH3F-ZYiZolfBZV3YnQDyMfyMwYQ6bdS8FK5iPw8YhYntlC52T1OTP5eMDKaFvPiG6lKebdXhk5LOmlWzr_gaSK4bWECrSiS7glCy6d7syHHaEEOmy-1MtGO5047dg0zdtM81LwPjQIFwK5aOxRoE2k8MMKVzg9QqnC_0kzaI8wuqjfj3RAgtB_3CIgJN1W9cGuJsZh8QZpkxLWIN-vs3PYU1eG6eMsF9kQ",
        "account_id": "c0c5f431-fe79-5268-9e89-b40bcfa2fff4",
        "token": "WfrrDWenueeHVj9cEZxEAI4yI7bt7xp47m7NRwKf0OdexTv3X3cyFCpJh1rtmuQ144PpaXmrXFqN2gX4cQmtbwHKAXzcJjEFeV2hDUfoNHx9WkPh1qaP1mZK1FJGNGpt",
        "name": "Firstname Lastname",
        "first_name": "Firstname",
        "last_name": "Lastname",
        "email": "demo@zbxalert.com",
        "premium": false,
        "managed": false,
        "last_login_date": "2017-03-02 15:44:48"
    }
}

Session aktualisieren

URL: https://api.zbxalert.com/v1/user/session
Method: PUT
Header: Content-Type: application/json
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

- no request data -

{
    "status": "ok",
    "statusDetail": "User authenticated",
    "requestId": "be2d42c8-4e1f-11e8-a8b4-7d427478a8b0",
    "session": {
        "session_token": "eyJ0e1AiOiJKV1QlLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4NWRkNmI5YmZjZWJjMDIzM2MxYzJmYTZmN2NiYWE3ZCIsInlzcyI6Imh0dHBzOi8vbGIwMS5tZXNzbmVyLmlvL2FwaS92Mi91c2VyL3Nlc3Npb24iLCJpYXQiOjE1MjUyNzU4ODgsImV4cCI6MTUyNTI3OTQ4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jQIFwK5aOxRoE2k8MMKVzg9QqnC_0kzaI8wuqjfj3RAgtB_3CIgJN1W9cGuJsZh8QZpkxLWIN-vs3PYU1eG6eMsF9kQ",
        "account_id": "c0c5f431-fe79-5268-9e89-b40bcfa2fff4",
        "token": "WfrrDWenueeHVj9cEZxEAI4yI7bt7xp47m7NRwKf0OdexTv3X3cyFCpJh1rtmuQ144PpaXmrXFqN2gX4cQmtbwHKAXzcJjEFeV2hDUfoNHx9WkPh1qaP1mZK1FJGNGpt",
        "name": "Firstname Lastname",
        "first_name": "Firstname",
        "last_name": "Lastname",
        "email": "demo@zbxalert.com",
        "premium": false,
        "managed": false,
        "last_login_date": "2017-03-02 15:44:48"
    }
}

Logout

URL: https://api.zbxalert.com/v1/user/session
Method: DELETE
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

- no request data -

{
    "status": "ok",
    "statusDetail": "User successfully logged out",
    "requestId": "b6b6dc86-4e1f-11e8-b8e4-2d2772d26263"
}

PublicKey abrufen

URL: https://api.zbxalert.com/v1/user/publickey/-ACCOUNTID-
Method: GET
Header: X-API-KEY

- no request data -
In der URL muß -ACCOUNTID- mit der AccountID des gewünschten Accounts ersetzt werden

{
    "status": "ok",
    "statusDetail": "publickey successfully requested",
    "requestId": "526e158e-4f89-11e8-9aaf-f378f3bb8beb",
    "publickey": "MIIBCgKCAQEA8QEkNzzSXU94JYyCAbpAASLMtDEyvI7hbM2xvnerhQomC1LEnGEFxOkH4wyqbCmGEDuPLOQ/Cs/mUzeH7fyOIw8eMuezGaT/qO4ZlG/Yoq+an2OxzXw2HwqSKLeBvL/xkYKqkGOz72WJeU5u5r4Fj9SKllEiN/SmviMvcpGj8qLYQhXMbt5ZJ1xYpWAax2fkc4wxx3gIQbxoTj7HprUFZrJjtLu+SXI8wCBp8CQEs3dDPAogQu+Vb6DfnF0BowTAcrLMQvYL/KNxU5TfvY8MeSjwY5lahqHQN/nSfmGerFPbfKYo24E8xB2eS8/3uoioFtRmO9QGklHZ5FUJw7yMYQIDAQAB"
}

Verwalteten Account anlegen

URL: https://api.zbxalert.com/
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

{
	"email": "demo1@zbxalert.com",
	"firstname": "First name",
	"lastname": "Last name",
	"password": "1SecurePassword!"
}
{
    "status": "ok",
    "statusDetail": "User successfully created",
    "requestId": "709gb6jh-4f1g-u7e8-weba-f4ehj2ad53fgr",
    "user": {
        "email": "demo1@zbxalert.com",
        "firstname": "First name",
        "lastname": "Last name",
        "accountId": "tcef0feo-gzb4-7u21-rt06-zu05h6a17kil",
        "token": "rfWfwpBygbEZoUTFufa0utpCZuwlNqlbl3jKtBbA4JAn9nS9VksuxTWn5ui3EaFNmRtmYDGH1ihkgS4Qd8Fw3jD7f6jtsh4O9WgRZx664eXrcalLHASdsK6alKSdWUtz"
    }
}

Verwalteten Account löschen

URL: https://api.zbxalert.com/v1/user/-ACCOUNTID-
Method: DELETE
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

- no request data -
In der URL muß -ACCOUNTID- mit der AccountID des gewünschten Accounts ersetzt werden
Nur Account Manager können verwaltete Accounts löschen

{
    "status": "ok",
    "statusDetail": "User successfully deleted",
    "accountId": "18b69170-17ec-4e2d-b061-f3338ff6721b"
}

Passwort Reset anfordern

URL: https://api.zbxalert.com/v1/user/reset
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
	"email": "demo@zbxalert.com"
}
{
    "status": "ok",
    "statusDetail": "Password reset successfully requested",
    "requestId": "343f6679-4f9d-11e8-93b3-71dbfd6ba245"
}

Password Reset

URL: https://api.zbxalert.com/v1/user/reset-password
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY

{
  "email": "demo@zbxalert.com",
  "code": "XS1NZOBY7ZQRVO184SV3G2WWGOY4TLMT",
  "new_password": "1SecurePassword!"
}
{
    "status": "ok",
    "statusDetail": "Password reset successfull",
    "requestId": "2cbfd8f8-66b1-11e9-8c6f-af234875c98z"
}
Ende der Account-Verwaltung

BENACHRICHTIGUNGEN

Benachrichtigung senden

URL: https://api.zbxalert.com/v1/message
Method: POST
Header: Content-Type: application/json
Header: X-API-KEY
Header: X-ZBXalertAPI-Token

{
	"recipient": "18b69170-17ec-4e2d-b061-f3338ff6721b",
	"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"
}
{
    "status": "ok",
    "statusDetail": "Message successfully sent",
    "requestId": "90db711a-4fb7-11e8-814a-39667866b640",
    "messageId": "-LBfxwhKDXm0gYij29Jy"
}

Benachrichtigungscounter abrufen

URL: https://api.zbxalert.com/v1/message/counter
Method: GET
Header: X-API-KEY
Header: X-ZBXalert-Session-Token

{
    "status": "ok",
    "statusDetail": "Counter successfully requested",
	"requestId": "8cbb1df1-4fb8-11e8-be0c-b932467241a4",
    "counter": {
        "creditMonthly": 50,
        "creditOnce": 0,
        "overallReceived": 1,
        "overallSent": 0,
        "received": 1,
        "sent": 0,
        "remaining": 49
    }
}

Benachrichtigungsstatus abrufen

URL: https://api.zbxalert.com/v1/message/-MessageId-
Method: GET
Header: X-API-KEY
Header: X-ZBXalertAPI-Token

Bitte verwenden Sie das Token des jeweiligen Accounts (Feld 'token') als X-ZBXalertAPI-Token Header

{
    "status": "ok",
    "statusDetail": "Message status successfully requested",
	"requestId": "f5bd2ddc-4fb9-11e8-aec1-b5be035a70cd",
    "message": {
        "acknowledged": false,
        "messageIdentifier": "km1_12345",
        "pushFailureCount": 0,
        "pushReceived": true,
        "pushReceivedCount": 1,
        "pushSent": true,
        "pushSuccessCount": 1,
        "read": false,
        "recipient": "1rb6917O-i7oc-4e2p-b041-f3238ff6721k",
        "timestamp": 1499013529992
    }
}
Ende der Benachrichtigungssektion