Power Alert Device Manger (v20)

REST API User’s Guide

 

Introduction

Beginning with version 20.0.0, PowerAlert Device Manager (PADM) supports a Representational State Transfer (REST) Application Programming Interface (API). This specification document defines the REST APIs, including the Uniform Resource Identifier (URI), method, parameters, request body and response body. These specifications are intended to provide all required details to call the PowerAlert REST APIs and to build scripts around these calls.

Supported REST API Version

 

PowerAlert Release

Rest API Version

20.0

1.0.0

 

The API version should be entered in the 'Accept-Version' header, as shown in the image below. If the version is not entered, the server returns the latest supported version. Third party systems that consume the PowerAlert API should provide the expected version in this header.

 

Client Request

GET https://{poweralert_endpoint}/api/devices   
Authorization: Bearer {access_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Guidelines

Authentication and Authorization

·       Authentication and Authorization of the PowerAlert API is based on the OAuth2.0 standard and uses a JSON Web Token (JWT)

·       A successful authentication request returns a valid access token

·       In all cases, a valid access token is required to interact with the PowerAlert API

·       Refer to the Authentication Model section of this document for additional details

Validation and Constraints

As shown below, an API response for a GET request has “meta” and “data” parts. The “meta” part consists of validation and constraints; the “data” part contains a response attribute in the form of key value pairs. Validation provides information about the data attribute (e.g. minimum and maximum), whereas constraints indicate whether a data attribute is required and can be edited or deleted. Refer to Appendix B for a detailed explanation of metadata.

 

{
        "meta": {
                 "id": "6a85a9a9-7f7a-4538-941c-c33dbacb3077",
                 "constraints": {
                         "max_items": 0,
                         "min_items": 0,
                         "editable_attributes": [
                                 "name",
                                 "location",
                         ],
                         "required_attributes": [],
                         "delete_allowed": true
                 },
                 "validation": [
                         {
                                 "attribute": "name",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 64,
                                 "pattern": "",
                                 "enum": [],
                                 "type": "string"
                         },
                         {
                                 "attribute": "location",
                                 "maximum": 0,
                                 "minimum": 0,
                                 "default": 0,
                                 "multiple_of": 0,
                                 "min_length": 1,
                                 "max_length": 80,
                                 "pattern": "",
                                 "enum": [],
                                 "type": "string"
                         }
                 ]
        },
        "data": {
                 "type": "devices",
                 "id": "1",
                 "attributes": {
                         "name": "device-123",
                         "manufacturer": "TRIPP LITE",
                         "location": "chicago"
                 }
        }
}

Validations and constraints may be omitted by turning the validation flag to false. e.g:  /api/email-contacts?validation=false

Required Attributes

Required attributes are needed when adding objects (POST requests). A list of required attributes for a specific endpoint are listed in the “meta” section of the GET response. In the example below, the “meta” section of the  GET /api/ localusers response lists the required attributes (shown in bold).

{
    "meta": {
        "id": "f760f23e-175d-4704-b81d-e37e5e34566b",
        "constraints": {
        
            "editable_attributes": [
               
            ],
            "required_attributes": [
                "name",
                "password",
                "role",
                "session_timeout_enabled",
                "idle_timeout_enabled"
            ],
            "delete_allowed": true
        },
        "validation": [
               ..]
        ...
       }
}            

Each update (PATCH) request supports partial updates in which case all the fields are not required. Only the values specified in the request body are updated; missing fields are omitted, retaining their values.

Content Type

Clients must send all requests with the following header:

Content-Type: application/vnd.api+json

The server responses also include this header.

API Unique Identifier

A unique identifier is required to create, read, update and/or delete an individual item. This identifier can either be ID or name. If using name as the identifier, then he following custom HTTP header is required to access data by name.

 

By: name

 

 

Authentication Model

Authentication Endpoint

PowerAlert uses the OAuth 2.0 token-based authentication model. Under this model, a user calls POST /api/outh/token to request an access token. A token is returned if the credential (user name and password) in the POST request is valid. The token appears in the headers of each subsequent request and determines if the user is authorized to perform the operation. The access token must be included in the HTTP header of subsequent requests.  For details see section Authentication (Login & Logout).

 

 

Authentication Request

POST https://{poweralert_endpoint}//api/oauth/token
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0
{
    "username":"localadmin",
    "password":"localadmin",
    "grant_type": "password"
}               

 

Authentication Response

 

On receiving a valid request, the server returns an access token and refresh token with a “successful” HTTP Error Code response:

 

Status: 200 OK

 

Refer to Appendix A for information on HTTP Error Codes.

{
    "access_token": "eyJ0eXoiVElNRUZPUk1BVF9ITU1TU1RUIiwiaWRsZV90aW1lb3V0Ijo2MCwic2Vzc2lvbl90aW1lb3V0IjozNlsibG9nX2ZpbGVzOnIiLCJzc2xfdXBsb2FkOnJ3Iiwic3NsX2Rvd25sb2FkOnIiLCJhcGk6cnciLCJlYnBfdXBsb2FkOnJ3Il19fQ.8fKhR3Rkk5AlVS3i4QosTlqXlx5TdX5uD9FN7w1p-9k",
    "msg": "Logged in as localadmin",
    "refresh_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MjMxNTY4OTksIm5iZiI6MTYyMzE1Njg5OSwianRpIjoiNjY2NzBmMWQtYzg2Ny00YzA4LWE1ZTQtMTQ1YjI2MjY1ZDExIiwiZXhwIjoxNjIzMTc4NDk5LCJpZGVudGl0eSI6ImxvY2FsYWRtaW4iLCJ0eXP3dHyMyqo41ur0NvZ9QveWNxu4Q"
}                      

 

Accessing Other APIs

 

To interact with PowerAlert API, a valid access token generated from a successful authentication response must be entered in the HTTP header. In the example below -- getting device information from PowerAlert – the token is entered in place of {access_token}. The IP address or host name is entered in place of {poweralert_endpoint}.

 

GET https://{poweralert_endpoint}/api/devices/1 
Authorization: Bearer {access_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Refresh Token

 

The refresh token helps to acquire a new access token when the existing one expires. Use the /api/oauth/refresh endpoint to refresh the access token. For the API to work, the refresh token must be included in the Authorization header.

 

Refresh Token Request:

POST https://{poweralert_endpoint}/api/oauth/refresh 
Authorization: Bearer {refresh_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Refresh Token Response:

Status: 200 OK
{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXlRJTUVGT1JNQVRfREVGQVVMVCIsImlkbGVfdGltZW91dCI6NjAsInNlc3Npb25fdGltZW91dCI6MzYwLCJwcml2aWxlZ2VzIjpbImxvZ19maWxlczpyIiwic3NsX3dyJdfX0.tuhFpE7XD4uZqsEUn1pL9wQB5Ne0bIJYYXv5nTHNIy4"
}

 

Logging Out

 

To Log Out, issue a logout API request to invalidate the existing access token.

 

Logout Request:

 

POST https://{poweralert_endpoint}/api/oauth/token/logout 
Authorization: Bearer {refresh_token}
Content-Type: application/vnd.api+json
Accept-Version: 1.0.0

 

Logout Response:

 

Status: 200 OK
{"msg":"Refresh token has been revoked"}

 

Examples

A number of basic examples are provided in this section; refer to the following link for additional examples.

https://documenter.getpostman.com/view/447714/TzeUn8vX

 

The following two variables are used throughout the examples:

·       {{DevEndpointHttps}} – This represents the HTTP(S) endpoint of a device, for example: http://10.22.0.98

·       {{access_token}} – This access token is required for interacting with the PowerAlert API Refer to the Authentication Model section of this document for details on obtaining this access token.

 

Device Properties

This section provides API examples on how to retireve and update attributes of a PowerAlert device and any peripherals connected to it.  Some attributes, such as “Device Name”, “Location”, “Installation Data” and “Asset Identifier” can be edited using device update service (PATCH /api/device/id).

 

Retrieving Device Properties

 

The example below retrieves all properties of the PowerAlert device and any connected peripherals. Specify the port if it different from the default values of 80 for HTTP or 443 for HTTPS.

 

Device Properties Request:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''     
 

Device Properties Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...
                               
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": [{
                       "type": "devices",
                       "id": "1",
                       "attributes": {
                               "device_id": 1,
                               "name": "Device0391",
                               "manufacturer": "TRIPP LITE",
                               "model": "SMART1500RM2U",
                               "serial_number": "2850DY0SM820600391",
                               "protocol": "3015",
                               "location": "Chicago",
                               "port_mode": "DEVICE_COMM_RS232",
                               "port_name": "/dev/ttyS2",
                               "region": "Mid West",
                               "install_date": "2021-05-17",
                               "deactivate_date": ""
                         ...
                       }
               },
               {
                       "type": "devices",
                       "id": "2",
                       "attributes": {
                               "device_id": 2,
                               "name": "Sensor0473",
                               "manufacturer": "TRIPP LITE",
                               "model": "E2MTHDI ",
                               "serial_number": "2833AV0AC89FC00473",
                               "protocol": "9300",
                               "location": "",
                               "port_mode": "DEVICE_COMM_RS232",
                               "port_name": "/dev/serial/by-id/usb-TRIPP_LITE_TRIPP_LITE_E2MTHDI_2833AV0AC89FC00473-if00",
                               "region": "",
                               "install_date": "2021-05-17",
                               "deactivate_date": "2021-05-21"
                         ....
                       }
               }
        ]
}

 

·       This example shows only a portion of the response; the device has many more attributes.

·       Use device id or name “/api/devices/{id}” to retrieve the attributes of one device.

·       Use the following HTTP header to retrieve attributes by device name

 

By: name

 

Retrieving a Device’s Properties by ID:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices/{DeviceId}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''  

 

Retrieving a Device’s Properties by name:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/devices/{DeviceName}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--header 'By: name' \
--data-raw ''  
 

 

 

Updating Editable Device Properties

 

Note that device ID or device name is required to edit attributes.

 

Device Update Request by ID:

 

curl --location -g --request PATCH '{{DevEndpointHttps}}/api/devices/{deviceId}' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw '{
               "data": {
                       "type": "devices",
                       "attributes": {
                       "id": "1",
                       "name": "Device0391",
                       "location": "Chicago",
                       "manufacturer": "TRIPP LITE",
                       "installDate": "2021-05-18",
                       "region": "USA",
                       "configured_device_id": 123,
                       "configured_asset_tag": "tripplitelight-0123456",
                       "install_date": "2021-05-18"
                       }
               }
         }'

·       The following attributes are editable: name, location, manufacturer, location, region, configured_device_id and configured_asset_tag.

·       Similar to GET, the device ID must be specified when requesting updates. Alternatively the device name can be used along with the following Http cusom header.

By: name

 

Device Update Request by name:

 

curl --location -g --request PATCH '{{DevEndpointHttps}}/api/devices/Device0391' \
--header 'Content-Type: application/vnd.api+json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--header 'By: name' \
--data-raw '{
               "data": {
                       "type": "devices",
                       "attributes": {
                       "id": "1",
                       "name": "Device0391",
                       "location": "Chicago",
                       "manufacturer": "TRIPP LITE",
                       "installDate": "2021-05-18",
                       "region": "USA",
                       "configured_device_id": 123,
                       "configured_asset_tag": "tripplitelight-0123456",
                       "install_date": "2021-05-18"
                       }
               }
         }'

 

Device Update Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "c143e284-a1b3-4d64-ad72-64092e3dfac8"
        },
        "data": {
               "type": "devices",
               "id": "1",
               "attributes": {
                       "response": 0
               }
        }
}

 

Device Metrics       

This section provides API examples for retrieving devices metrics (variables), including:

·       Runtime Remaining

·       Battery Voltage

·       Battery Capacity

·       Input and Output Voltage / Current

·       Input and Output Frequency

·       Output Utilization

·       Temperature

 

Metrics can be retrieved as a full set or by individual variable

 

Retrieving All Device Metrics

 

Device Metrics Request:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \    
--data-raw ''
 

 

Device Metrics (Variables) Response:

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...            
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": [{
                       "type": "variables",
                       "id": "1",
                       "attributes": {
                               "key": 872415338,
                               "device_id": 1,
                               "device_name": "Device0391",
                               "device_type": "DEVICE_TYPE_UPS",
                               "label": "Runtime Remaining (Min)",
                               "value": "474",
                               "min_value": 0,
                               "max_value": 1440,
                               "suffix": "Minutes",
                               "group": "VARGROUP_BATTERY",
                               "purpose": "VARPURPOSE_STATUS",
                               "data_type": "VARTYPE_INTEGER",
                               "state": "DEVICE_STATE_NORMAL",
                               "display_label": "Runtime Remaining",
                               "raw_value": "474",    
                               ....
                       }
               },
               {
                       "type": "variables",
                       "id": "2",
                       "attributes": {
                               "key": 872415360,
                               "device_id": 1,
                               "device_name": "Device0391",
                               "device_type": "DEVICE_TYPE_UPS",
                               "label": "Battery Capacity",
                               "value": "100",
                               "min_value": 0,
                               "max_value": 100,
                               "suffix": "%",
                               "group": "VARGROUP_BATTERY",
                               "purpose": "VARPURPOSE_STATUS",
                               "data_type": "VARTYPE_INTEGER",
                               "state": "DEVICE_STATE_NORMAL",
                               "display_label": "Battery Capacity",
                               "raw_value": "100",
                         ....
                       }
               },
               ...             
        ]
}

 

·       This example shows only a portion of the response; the device has many more variables.

·       This response shows all variables for the PowerAlert device and connected peripherals – Each variable has a device ID, type and details

·       Attribute “label” is the variable name, “value” is the value of the variable and “suffix” is the unit of measure.

 

Retrieving Individual Device Metrics

 

Request Using ID:

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables/{variableId}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''
 

Where {variableId} is the device metric ID or variable ID

 

Retrieve a variable using its ID:

https://10.22.0.58/api/variables/7

 

 A variable can also be retrieved using its name in which case the following values must be included in the HTTP header.

·       “By : name”

·       “deviceId : {id}” or “deviceName: {name}” – Where id is the unique ID of the device and name is the name of the device 

 

Request Using Name:

 

curl --location -g --request GET '{{DevEndpointHttps}}/api/variables/{variableName}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{access_token}}' \
--header 'By: name' \
--header 'deviceName: Device0391' \
--header 'Accept-Version: 1.0.0' \
--data-raw ''

 

Where {variableName} is device metric name or variable name

 

Example: https://10.22.0.98/api/variables/Runtime Remaining (Min)

 

Response:

 

Status: 200 OK

 

{
        "meta": {
               "id": "a0dd05e8-729e-4a20-907d-ef4994731226",
               "constraints": {
                       "max_items": 0,
                       "min_items": 0,
                       "editable_attributes": [
                               ...            
                       ],
                       "required_attributes": [],
                       "delete_allowed": true
               },
               "validation": [{
                  ..
               }
               ]
        },
        "data": {
               "type": "variables",
               "id": "1",
               "attributes": {
                       "key": 872415338,
                       "device_id": 1,
                       "device_name": "Device0391",
                       "device_type": "DEVICE_TYPE_UPS",
                       "label": "Runtime Remaining (Min)",
                       "value": "474",
                       "min_value": 0,
                       "max_value": 1440,
                       "suffix": "Minutes",
                       "group": "VARGROUP_BATTERY",
                       "purpose": "VARPURPOSE_STATUS",
                       "data_type": "VARTYPE_INTEGER",
                       "state": "DEVICE_STATE_NORMAL",
                       "display_label": "Runtime Remaining",
                       "raw_value": "474",    
                         ....
               }
        }
}

API Reference

All PowerAlert REST APIs leverage HTTP Status Codes to indicate errors and successful responses. Refer to Appendix A for details.

Actions

Action APIs enable configuration of action parameters applicable to the device and connected peripherals. Below are examples of configurable action parameters, followed by the supported enumerations (enums):

·       Delay – the number of seconds the action will wait to execute after being triggered

·       Target Device – the device undergoing the action

·       Interval – the number of seconds between successive executions of the action

·       Count – the number of times the action will be executed

·       Contacts – one or more notification/trap/set recipients

·       Action Type – the type of action; each has an enumeration value

·       Trigger Event – the trigger for the action, occurring either when the event is set (On Set) or cleared (On Clear). These events contains additional attributes pertaining to the event (device, load, etc). 

 

source_type:

EVENT_SOURCE_TYPE_DEVICE
EVENT_SOURCE_TYPE_AUTOPROBE
EVENT_SOURCE_TYPE_SYSTEM

 

action_type:

ACTIONTYPE_REBOOT_WEBLX

ACTIONTYPE_TURN_OFF_DEVICE

ACTIONTYPE_TURN_ON_DEVICE

ACTIONTYPE_SENSOR

ACTIONTYPE_EMAIL

ACTIONTYPE_SNMP_SET_OID

ACTIONTYPE_SNMP_TRAP

ACTIONTYPE_SMS

ACTIONTYPE_LOAD

ACTIONTYPE_LOAD_GROUP

ACTIONTYPE_RAMP

ACTIONTYPE_SHED

ACTIONTYPE_EXEC_SCRIPT

ACTIONTYPE_SHUTDOWN_OS

ACTIONTYPE_REBOOT_OS

ACTIONTYPE_REMOTE_SHUTDOWN

ACTIONTYPE_RESTART_DEVICE

 

 

GET All Actions

This API returns a summary of all available actions.

 

Title

GET All Actions                                                                                                

URL

/api/actions

Method

GET

Success Response

Code: 200
Content: {

    "meta": {

        "id": "837e874a-507e-4061-b6f9-f6835e977e9e",

        "constraints": {

                   ..

        },

        "validation": [

          

        ]

    },

    "data": [

        {

            "type": "actions",

            "id": "1",

            "attributes": {

                "name": "Default Email Notification", //String ValueAction Name

                "action_type": "ACTIONTYPE_EMAIL", //ActionType ENUM

                "key": 1281,// <Intger value>

                "delay": 30, //Delay integer value

                "interval": 0,// Integer Value

                "count": 1, // Integer Value

                "enabled": true,

                "redundant": false,

                "set_events": 25, // Integer Value

                "clear_events": 25 // Integer Value           }

        }

  ]

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 

http://localhost:3001/api/actions

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Action

This API deletes an action, based on action ID or action name

 

Title

Delete Action                                                                                               

URL

/api/actions/:actionId

OR

To delete using name: /api/actions/:actionName 

"by:name" http header is required to delete by name

Method

DELETE

Success Response

Code: 200
Content: {

    "meta": {

        "id": "b3039324-3961-4188-b6b1-649daf7794fb"

    },

    "data": {

        "type": "actions",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Sample Call

curl –I -H "Accept: application/vnd.api+json" –X "DELETE”

http://localhost:3001/api/actions/7

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Delete Multiple Actions

This API deletes multiple actions based on the action IDs provided in the body

 

Title

Delete Multiple Actions

URL

/api/actions

Method

DELETE

Data Params

{

       "data": [{

             "type": "actions",

             "id": "9" //Integer Action ID

       }, {

             "type": "actions",

             "id": "10"

       }]

}

Success Response

Code: 200
Content: {

    "meta": {

        "id": "bf1c99d8-d8c4-4fbf-8cb7-eb9facdde7c3" //Request Id

    },

    "data": [

        {

            "type": "actions",

            "id": "9" //Integer action Id

        },

        {

            "type": "actions",

            "id": "10"

        }

    ]

}

Version 

"Accept-Version: 1.0.0"

                       

 

GET Supported Actions

This API provides the Boolean value for each of the action types, indicating support for on_set, on_clear and mutually_exclusive. If mutually_exclusive is set to true, either on_set or on_clear can be supported, but not both.

 

Title

GET Supported Actions

URL

/api/actions/supported

Method

GET

Success Response

Code: 200
Content: {

       "meta": {

             "id": "1d20d459-83a4-4168-8aa9-debfbcc6e6a5"

       },

       "data": {

             "type": "actions-supported",

             "id": "ActionsSupported",

             "attributes": {

                    "email_supported": {

                          "supported_on_set": true, //Boolean

                          "supported_on_clear": true, //Boolean

                          "mutually_exclusive": false //Boolean

                    },

                    "sms_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false

                    },

                    "snmp_trap_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false

                    },

                    "snmp_set_oid_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": true

                    },

                    "reboot_webcardlx_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "turn_off_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "turn_on_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1, //Integer

                                 "name": "Device0391" //String

                          }]

                    },

                    "reboot_os_supported": {

                          "supported_on_set": false,

                           "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "sensor_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": []

                    },

                    "ramp_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": true,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "shed_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "load_action_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": true,

                          "mutually_exclusive": true,

                           //Load identifier for deviev

                          "load_identity_per_device": [{

                                 "device": {

                                       "id": 1, //Integer device Id

                                       "name": "Device0391"

                                 },

                                 "loads": [{

                                              "id": "1", //Integer load id

                                              "name": "Load number 1",//String load number

                                              "load_number": 1 //Integer

                                       },

                                       {

                                              "id": "2",

                                              "name": "Load 2",

                                              "load_number": 2

                                       }

                                 ]

                          }]

                    },

                    "load_group_action_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": true,

                           "load_group_identity_per_device": []

                    },

                    "remote_shutdown_supported": {

                          "supported_on_set": false,

                          "supported_on_clear": false,

                          "mutually_exclusive": false

                    },

                    "mute_alarm_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "initiate_self_test_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391"

                          }]

                    },

                    "restart_device_supported": {

                          "supported_on_set": true,

                          "supported_on_clear": false,

                          "mutually_exclusive": false,

                          "devices": [{

                                 "id": 1,

                                 "name": "Device0391",// String device name

                                 "parameters": {

                                       "Cmd Turn On Device (Delayed) Data": "Seconds"

                                 }

                          }]

                    }

             }

       }

}

Version 

"Accept-Version: 1.0.0"

 

 

Email Action

 

The Email Action endpoint provides a Create, Read, Update, Delete (CRUD) API for email actions.  Email Action has attributes ‘email_contact’ and ‘send_to_all’. If attribute ‘send_to_all’ is set to true, the email will be sent to all email contacts. If set to false, the ‘email_contact’ field must contain one or more valid email contact IDs.

 

GET Email Action

 

Title

GET Email action                                                                                                

URL

/api/email_actions

Method

GET

URL Params

Get Email Action

/api/email_actions/:actionId - By id (default)

or

/api/email_actions/:actionName

Note: No HTTP header required to get email action by id

http header "by: name" required to get email action by name

Success Response

Code: 200
Content
{

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type": "email_actions",

        "id": "11",

        "attributes": {

            "name": "email_action",

            "key": 0,

            "delay": 0,

            "enabled": true,

            "trigger_events": [

                {

                    "id": "5",

                    "key": 0,

                    "name": "",

                    //ENUM EventSourceTYpe

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_id": 1, //Integer is

                    "source_name": "Device0391",

                    "action_id": "11",//Integer action id

                    "action_name": "",

                    "fire_on_set": false,

                    "fire_on_clear": true

                }

            ],

            "interval": 0,

            "count": 1,

            "send_to_all": true,

            "email_contact": []

        }

    }

}

Sample Call

curl –i -H "Accept: application/vnd.api+json" 
http://localhost:3001/api/email_actions/11

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Email Action

 

Title

Create Email Action

URL

/api/email_actions

Method

POST

Data Params

{

       "data": {

             "type": "email_actions",

             "attributes": {

                    "name": "Email Action",

                    "interval": 0,

                    "delay": 0,

                    "count": 1,

                    "enabled": true,

                    "key": 0,

                    "send_to_all": true,

                    "trigger_events": [{

                          "id": "5",

                          "name": "Overload",

                          "fire_on_set": true,

                          "fire_on_clear": false,

                          "action_name": "Email Action",

                           //ENUM EventSourceType

                          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                          "source_id": 1,

                          "source_name": "Device0391",

                          "key": 0

                    }]

             }

       }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "email_actions",

             "id": "8", //Integer – Action ID

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Email Action

 

Title

Update Email Action

URL

/api/email_actions

Method

PATCH

URL Params

PATCH Email Action

/api/email_actions/:actionId - By id (default)

or

/api/email_actions/:actionName

Note: No HTTP header required to get email action by id

http header "by: name" required to update email action by name

Data Params

{

       "data": {

             "type": "email_actions",

             "attributes": {

                    "name": "Email Action2",//String Value

                    "interval": 0, //Intger Value

                    "delay": 0, //Intger Value

                    "count": 1, //Intger Value

                    "enabled": true,

                    "key": 0, //Intger Value

                    "send_to_all": true,

                    "trigger_events": [{

                          "id": "5", //Intger Value

                          "name": "Overload",//String Value

                          "fire_on_set": true,

                          "fire_on_clear": false,

                          "action_name": "Email Action",

                          "source_type": "EVENT_SOURCE_TYPE_DEVICE",//Enum Event Source

                          "source_id": 1, //Intger Value

                          "source_name": "Device0391", //String Value

                          "key": 0 //Intger Value

                    }]

             }

       }

}

Success Response

Code: 200
Content: {

       "meta": {

              "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "email_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

The payload for update is similar to create. Alternatively update api allow to add and remove list of email contacts, set and clear events. Example:

 

    "remove_set_events" : [

          {

            "name" : "seteventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename2"

          }

        ],

        "add_email_contact" : [

          {

            "name" : "contact1"

          },

          {

            "name" : "contact2"

          }

        ],

        "add_clear_events" : [

          {

            "name" : "cleareventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "add_set_events" : [

          {

            "name" : "seteventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "remove_email_contact" : [

          {

            "name" : "contact3"

          },

          {

            "name" : "contact4"

          }

        ],

        "remove_clear_events" : [

          {

            "name" : "cleareventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

...

 

Initiate Self-Test Action

 

The Initiate Self-Test Action endpoint provides a CRUD API for Initiate Self-Test actions. It requires a target device identity in the form of ‘device_name’ or ‘device_id’.

 

GET Initiate Self-Test Action

 

Title

GET Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

GET

URL Params

Get Initiate Self-Test Actions

/api/initiate_self_test_actions/:actionId

- By id (default)

or

/api/initiate_self_test_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type": "email_actions",

        "id": "11",

        "attributes": {

         "name": "anInitiateSelfTestActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            //ENUM EventSourceType

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "20",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create an Initiate Self-Test Action

 

Title

Create Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0, //Integer delay

      "device_id" : 1, //Integer device id

      "key" : 1, //Integer key

      "name" : "anInitiateSelfTestActionName"

    },

    "type" : "initiate_self_test_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "initiate_self_test_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update an Initiate Self-Test Action

 

Title

Update Initiate Self-Test Action

URL

/api/initiate_self_test_actions

Method

PATCH

URL Params

PATCH Initate Self Test

api/initiate_self_test_actions/:actionId – by default (id)

or

/api/initiate_self_test_actions/:actionName

Note: No HTTP header required to update email action by id

http header "by: name" required to update email action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "anInitiateSelfTestActionName"

    },

    "type" : "initiate_self_test_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "initiate_self_test_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

The payload for update is similar to create. Alternatively update api allow to add and remove list, set and clear events. Example:

 

     "remove_set_events" : [

          {

            "name" : "seteventname2",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename2"

          }

        ],

        "add_clear_events" : [

          {

            "name" : "cleareventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ],

        "add_set_events" : [

          {

            "name" : "seteventname1",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_name" : "sourcename1"

          }

        ...

 

 

Load Control Action

 

The Load Control Action endpoint provides a CRUD API for Load Control actions. It requires device ID, load identifier (load ID or name and load number) and load action. This API uses the following enums:

 

load_actions:

LOAD_ACTION_IDLE

LOAD_ACTION_OFF

LOAD_ACTION_ON

LOAD_ACTION_CYCLE

 

GET Load Control Action  

 

Title

GET Load Control Action

URL

/api/load_control_actions

Method

GET

URL Params

Get Load Control Actions

/api/load_control_actions/:actionId

- By id (default)

or

/api/load_control_actions/actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "load_control_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               //ENUM EventSourceType

               "source_type": "EVENT_SOURCE_TYPE_DEVICE",

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "load_identifier":          [

                        {

               "id": "1",

               "name": "",

               "load_number": 0

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         },

         "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Load Control Action

 

Title

Create Load Control Action

URL

/api/load_control_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_identifier": [

        {

            "id": 1,

            "name": "",

            "load_number": 1        

        }

      ],

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

    },

    "type" : "load_control_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Load Control Action

 

Title

Update Load Control Action

URL

/api/load_control_actions

Method

PATCH

URL Params

PATCH Load Control Action

api/load_control_actions/actionId – by default (id)

or

/api/load_control_actions/:actionName

Note: No HTTP header required to update action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_identifier": [

        {

            "id": 1,

            "name": "",

            "load_number": 1        

        }

      ],

 

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      

    },

    "type": "load_control_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Load Group Control Action

 

The Load Group Control Action endpoint provides a CRUD API for Load Group Control actions, requiring device ID, load group identifier (load group id or name) and load action. It uses the following enums:

 

load_action:
LOAD_ACTION_IDLE
LOAD_ACTION_OFF
LOAD_ACTION_ON
LOAD_ACTION_CYCLE

 

 

GET Load Group Control Action  

 

Title

GET Load Group Control Action

URL

/api/load_group_control_actions

Method

GET

URL Params

Get Load Group Actions

/api/load_group_control_actions/:actionId

- By id (default)

or

/api/load_group_control_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "load_control_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "load_group_identifier":[

               {

               "id": "1", //load group id

               "name": ""

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         },

         "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Load Group Control Action

 

Title

Create Load Group Action

URL

/api/load_group_control_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1, // Integer device id

      "key" : 1,

      "name" : "aLoadGroupControlActionName",

      " load_group_identifier [

        {

            "id": 1, //Integer Load group ID

            "name": ""        

        }

      ],

      "load_action": "LOAD_ACTION_ON" //ENUM LoadAction

    },

    "type" : "load_group_control_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_group_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Load Group Control Action

 

Title

Update Load Group Control Action

URL

/api/load_group_control_actions

Method

PATCH

URL Params

PATCH Load Group Control Action

api/load_group_control_actions /actionId – by default (id)

or

/api/load_group_control_actions /:actionName

Note: No HTTP header required to get load group action by id

http header "by: name" required to update load group action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1", //Integer event id

          "source_id" : 1, //Integer source id

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //Enum – Load Group id

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aLoadControlActionName",

      "load_group_identifier": [

        {

            "id": 1, //Integer Load group id

            "name": "" //Optional String Load group name

        }

      ],

      "load_action": "LOAD_ACTION_ON"    

    },

    "type": "load_group_control_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "load_group_control_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Mute Alarm Action

 

The Mute Alarm Action endpoint provides a CRUD API for Mute Alarm actions. It requires ‘device_id’ or ‘device_name’ and delay value.

 

 

GET Mute Alarm Action  

 

Title

GET Mute Alarm Action

URL

/api/mute_alarm_actions

Method

GET

URL Params

/api/mute_alarm_actions/:actionId - By id (default)

or

/api/mute_alarm_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

      "type": "mute_alarm_actions",

      "id": "7",

      "attributes":       {

         "name": "aLoadControlActionName",

         "key": 0,

         "delay": 2,

         "enabled": true,

         "trigger_events":          [

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceType

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

         "device_identity":          {

            "device_id": 1,

            "device_name": "" //String device name

         }

      }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Mute Alarm Action

 

Title

Create Mute Alarm Action

URL

/api/mute_alarm_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE", //ENUM EventSourceTyps

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aMuteAlarmAction"

    },

    "type" : "mute_alarm_actions"

  }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "mute_alarm_actions",

             "id": "8",

              "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Mute Alarm Action

 

Title

Update Mute Alarm Action

URL

/api/mute_alarm_actions

Method

PATCH

URL Params

api/mute_alarm_actions /actionId – by default (id)

or

/api/mute_alarm_actions /:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aMuteActionName”,

    },

    "type": "mute_alarm_actions"

   }

}

Success Response

Code: 200
Content: {

       "meta": {

             "id": "50771da9-a56b-43ca-a324-0c95f0104c99"

       },

       "data": {

             "type": "mute_alarm_actions",

             "id": "8",

             "attributes": {

                    "response": 0

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Ramp Action

 

The Ramp Action endpoint provides a CRUD API for Ramp actions. It requires ‘device_id’ or ‘device_name’.

 

GET Ramp Action  

 

Title

GET Ramp Action

URL

/api/ramp_actions

Method

GET

URL Params

/api/ramp_actions/:actionId- By id (default)

or

/api/ ramp_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

   "data":    {

      "type": "ramp_actions",

      "id": "14",

      "attributes":       {

         "name": "aRampActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "14",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         }

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create Ramp Action

 

Title

Create Ramp Action

URL

/api/ramp_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aRampActionName"

    },

    "type" : "ramp_actions"

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/ramp_actions"

  },

  "data" : {

    "type" : "ramp_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Update Ramp Action

 

Title

Update Ramp Action

URL

/api/ramp_actions

Method

PATCH

URL Params

/api/ramp_actions/:actionId

or

/api/ramp_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aRampActionName"

    },

    "type" : "ramp_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/ramp_actions"

  },

  "data" : {

    "type" : "ramp_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Reboot OS Action

 

The Reboot Action endpoint provides a CRUD API for Reboot OS actions. This API is supported only for PowerAlert Office/Home/Medical.

 

GET Reboot OS Action  

 

Title

GET Reboot OS Action

URL

/api/reboot_os_actions

Method

GET

URL Params

/api/reboot_os_actions /:actionId

or

/api/reboot_os_actions /:actionName

Note: No HTTP header required to get reboot os action by id

http header "by: name" required to get action by name

Success Response

   "data":    {
      "type": "reboot_os_actions",
      "id": "12",
      "attributes":       {
         "name": "<String>",
         "key": <Integer>,
         "delay": <Integer>,
         "enabled": <Boolean>,
         "redundant": <Boolean>,
         "trigger_events":[

                        {

               "id": "1",

               "key": 0,

               "name": "",

               "source_type": "EVENT_SOURCE_TYPE_DEVICE",

               "source_id": 1,

               "source_name": "",

               "action_id": "7",

               "action_name": "",

               "fire_on_set": true,

               "fire_on_clear": true

            }

         ],

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Create Reboot OS Action

 

Title

Create Reboot OS Action

URL

/api/reboot_os_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "<String ID>",
          "source_id" : "<Integer>",
          "fire_on_clear" : "<Boolean>",
          "source_type" : "<Enum source type>",
          "fire_on_set" : "<Boolean>"
        }
      ],
      "name": "<String>"
      "delay": <Integer>,
      "enabled": <Boolean>,
      "redundant": <Boolean>

    },
    "type" : "reboot_os_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/reboot_os_actions"
  },
  "data" : {
    "type" : "reboot_os_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Reboot OS Action

 

Title

Update Reboot OS Action

URL

/api/reboot_os_actions

Method

PATCH

URL Params

/api/reboot_os_actions /:actionId

or

/api/reboot_os_actions /:actionName

Note: No HTTP header required to get ramp action by id

http header "by: name" required to update reboot os action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],     

      "name": "<String>"
      "delay": <Integer>,
      "enabled": <Boolean>,
      "redundant": <Boolean>,

      "add_set_events" : [
       {
         "name" : "<String>",
         "source_type": "<Enum : Source Type>",
         "source_name" : "<Source Name>"
       },

 

      "remove_set_events" : [
       {
         "name" : "<String>",
         "source_type": "<Enum : Source Type>",
         "source_name" : "<Source Name>"
       }    

     }
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/reboot_os_actions"
  },
  "data" : {
    "type" : "reboot_os_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Reboot Web LX Action

The Reboot Web LX Action endpoint provides a CRUD API for Rebooting LX actions.

 

GET Reboot Web LX Action  

 

Title

GET Reboot Web LX Action

URL

/api/reboot_web_lx_actions

Method

GET

URL Params

/api/reboot_web_lx_actions/:actionId

or

/api/reboot_web_lx_actions/:actionName

Note: No HTTP header required to get reboot web lx action by id

http header "by: name" required to get action by name

Success Response

  {

   "data":    {

      "type": "reboot_web_lx_actions",

      "id": "12",

      "attributes":       {

         "name": "aRebootWebLxActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "12",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }]

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Reboot Web LX Action  

 

Title

Create Reboot Web LX Action

URL

/api/reboot_web_lx_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "key" : 1,

      "name" : "aRebootWebLxActionName"

    },

    "type" : "reboot_web_lx_actions"

  }

}

Success Response

Code: 201
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/reboot_web_lx_actions"

  },

  "data" : {

    "type" : "reboot_web_lx_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Reboot Web LX Action  

 

Title

Update Reboot Web LX Action

URL

api/reboot_web_lx_actions

Method

PATH

URL Params

api/reboot_web_lx_actions/:actionId

or

/api/reboot_web_lx_actions/:actionName

Note: No HTTP header required to get ramp action by id

http header "by: name" required to update reboot os action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "key" : 1,

      "name" : "aRebootWebLxActionName"

    },

    "type" : "reboot_web_lx_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/reboot_web_lx_actions"

  },

  "data" : {

    "type" : "reboot_web_lx_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Script Actions

 

The Script Action endpoint provides a CRUD API for Script actions. This API is supported only for PowerAlert Office/Home/Medical.

 

GET Script Action  

 

Title

GET Script Action

URL

/api/script_actions

Method

GET

URL Params

/api/script_actions/:actionId

or

/api/script_actions/:actionName

Note: No HTTP header required to get reboot web lx action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

   "data":    {
      "type": "script_actions",
      "id": "12",
      "attributes":       {
         "name": "scriptactions",
         "key": 0,
         "delay": 0,
         "enabled": true,
         "script": 0,
         "redundant": true,
         "trigger_events": [         {
          
         }]
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Create Script Action  

 

Title

Create Script Action

URL

/api/script_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "1",
          "source_id" : 1,
          "fire_on_clear" : true,
          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",
          "fire_on_set" : true
        }
      ],
      "enabled" : true,
      "delay" : 0,
      "key" : 1,
      "name" : "scriptactionsName",
      "script": "test_script2",
      "redundant": true
    },
    "type" : "script_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/script_actions"
  },
  "data" : {
    "type" : "script_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Script Action  

 

Title

Update Script Action

URL

/api/script_actions

Method

PATH

URL Params

/api/script_actions/:actionId

or

/api/script_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],
      "enabled" : <Boolean>,
      "delay" : 0,
      "key" : 1,
      "name" : "aScriptActionName",
      "script" : "test_script3",
      "name" : "aScriptActionName"
    },
    "redundant" : true
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/script_actions"
  },
  "data" : {
    "type" : "script_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Sensor Actions

 

The Sensor Action endpoint provides a CRUD API for Sensor actions. It uses the following enums:

 

contact:
CONTACTS_SENSOR_CONTACT_1
CONTACTS_SENSOR_CONTACT_2

contact_state:
CONTACTSTATE_SENSOR_STATE_OPEN
CONTACTSTATE_SENSOR_STATE_CLOSED

 

GET Sensor Action  

 

Title

GET Sensor Action

URL

/api/sensor_actions

Method

GET

URL Params

/api/sensor_actions/:actionId

or

/api/sensor_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

  "data":    {
       "type": "sensor_actions",
       "id": "9",
       "attributes":       {
          "name": "aSensorActionName",
          "key": 0,
          "delay": 0,
          "enabled": true,
          "trigger_events": [         {
             "id": "1",
             "key": 0,
             "name": "",

             "source_type": "EVENT_SOURCE_TYPE_DEVICE", //Event Source Type Enum
             "source_id": 1,
             "source_name": "",
             "action_id": "9",
             "action_name": "",
             "fire_on_set": true,
             "fire_on_clear": true
          }],
          "device_identity":          {
             "device_id": 1,
             "device_name": ""
          },
          "contact": "CONTACTS_SENSOR_CONTACT_1", //contact Enum
          "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN" //contact_state Enum
       }
    }
 }

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Sensor Action  

 

Title

Create Sensor Action

URL

/api/sensor_actions

Method

POST

Data Params

{
    "data": {
        "type": "sensor_actions",
        "attributes": {
            "name": "aSensorActionName",
            "key": 1,
            "delay": 0,
            "enabled": true,
            "device_id": 2,
            "contact": "CONTACTS_SENSOR_CONTACT_1",
            "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN",
            "trigger_events": [
                { "id": "1",
                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",
                  "source_id": 1,

"source_name": "",
                  "fire_on_set": true,
                  "fire_on_clear": true 
                }
            ]
        }
    }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : 
"/api/sensor_actions"
  },
  "data" : {
    "type" : "
sensor_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Sensor Action  

 

Title

Update Sensor Action

URL

/api/sensor_actions

Method

PATH

URL Params

/api/sensor_actions/:actionId

or

/api/sensor_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{   "data": {
    "type": "sensor_actions",
    "attributes": {
        "name": "aSensorActionName",
        "key": 1,
        "delay": 0,
        "enabled": true,
        "device_id": 2,
        "contact": "CONTACTS_SENSOR_CONTACT_1",
        "contact_state": "CONTACTSTATE_SENSOR_STATE_OPEN",
        "trigger_events": [
            { "id": "1",
              "source_type": "EVENT_SOURCE_TYPE_DEVICE",
              "source_id": 1,

"source_name": "",
              "fire_on_set": true,
              "fire_on_clear": true 
            }
        ]
    }
}
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" "/api/sensor_actions"
  },
  "data" : {
    "type" : "sensor_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Shed Actions

 

The Shed Action endpoint provides a CRUD API for Shed actions.

 

GET Shed Action  

 

Title

Get Shed Action

URL

/api/shed_actions

Method

GET

URL Params

/api/shed_actions/:actionId

or

/api/shed_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

"data":    {

      "type": "shed_actions",

      "id": "14",

      "attributes":       {

         "name": "aShedActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "14",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "device_identity":          {

            "device_id": 1,

            "device_name": ""

         }

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Shed Action  

 

Title

Create Shed Action

URL

/api/shed_actions

Method

POST

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aShedActionName"

    },

    "type" : "shed_actions"

  }

}

Success Response

Code: 201

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/shed_actions"

  },

  "data" : {

    "type" : "shed_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Shed Action  

 

Title

Update Shed Action

URL

/api/shed_actions

Method

PATCH

URL Params

/api/shed_actions/:actionId

or

/api/shed_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "fire_on_clear" : true,

          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 0,

      "device_id" : 1,

      "key" : 1,

      "name" : "aShedActionName"

    },

    "type" : "shed_actions"

  }

}

Success Response

Code: 200
Content:

{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/shed_actions"

  },

  "data" : {

    "type" : "shed_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Shutdown Actions

 

The Shutdown Action endpoint provides a CRUD API for Shutdown actions.

 

 

GET Shutdown Action  

 

Title

GET Shutdown Action

URL

/api/shutdown_actions

Method

GET

URL Params

/api/shutdown_actions/:actionId

or

/api/shutdown_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

"data":    {
      "type": "shutdown_actions",
      "id": "12",
      "attributes":       {
         "name": "<Sting: action name>",
         "key": "<Integer>",
         "shutdown_os": "<Boolean>",

         "shutdown_os_delay": "<Boolean>",
         "shutdown_device": "<Boolean>",
         "enabled": "<Boolean>",
         "shutdown_device_delay": "<Boolean>",
         "redundant": "<Boolean>",
         "trigger_events": [         {
          
         }]
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Create Shutdown Action  

 

Title

Create Shutdown Action

URL

/api/shutdown_actions

Method

POST

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
        {
          "id" : "1",
          "source_id" : 1,
          "fire_on_clear" : true,
          "source_type" : "EVENT_SOURCE_TYPE_DEVICE",
          "fire_on_set" : true
        }
      ],

      "enabled" : "<Boolean>",
      "shutdown_os_delay" : <Integer>,
      "shutdown_os" : <Boolean>,
      "name" : "<String>",
      "shutdown_device_delay": "<Integer>",
      "shutdown_device": "<Boolean>",
      "redundant": "<Boolean>"
    },
    "type" : "shutdown_actions"
  }
}

Success Response

Code: 201
{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "id" : "7",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Update Shutdown Action  

 

Title

Update Shutdown Action

URL

/api/shutdown_actions

Method

PATCH

URL Params

/api/shutdown_actions/:actionId

or

/api/shutdown_actions/:actionName

Note: No HTTP header required to get sensor action by id

http header "by: name" required to update action by name

Data Params

{
  "data" : {
    "attributes" : {
      "trigger_events" : [
      ],

 

      "enabled" : "<Boolean>",
      "shutdown_os_delay" : <Integer>,
      "shutdown_os" : <Boolean>,
      "name" : "<String>",
      "shutdown_device_delay": "<Integer>",
      "shutdown_device": "<Boolean>",
      "redundant": "<Boolean>"    }
  }
}

Success Response

Code: 200
Content:

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

Shutdown Home Action

 

The Shutdown Home Action endpoint provides a CRUD API for Shutdown actions. This API is supported only for PowerAlert Office/Home/Medical. It uses the following enums:

 

type:
SHUTDOWN_HOME_NONE
SHUTDOWN_HOME_ON_BATTERY
SHUTDOWN_HOME_POWER_REMAINING
SHUTDOWN_HOME_RUNTIME_REMAINING
SHUTDOWN_HOME_BATTERY_LOW

 

 

GET Shutdown Home Action

                                                                             

Title

GET Shutdown Home Action

URL

/api/shutdown_home_actions

Method

GET

Success Response

{
   "meta":    {
     
   },
   "data":    {
      "type": "shutdown_home_actions",
    
      "attributes":       {
         "shutdown_supported": "<Boolean>",
         "on_battery_supported": "<Boolean>",
         "battery_power_remaining_supported": "<Boolean>",

         "battery_time_remaining_supported": "<Boolean>",
         "battery_low_supported": "<Boolean>",
         "enabled": "<Boolean>",
         "shutdown_device_delay": "<Boolean>",
         "type": "<ENUM Shutdown type>",
         "on_battery_delay": "<Integer>",
         "percent_battery_remaining":"<Integer>",
         "minutes_battery_remaining": "<Integer>"

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Update Shutdown Home Action  

 

Title

Update Shutdown Action

URL

/api/shutdown_actions

Method

PATCH

Data Params

{
  "data" : {
    "attributes" : 

     "type": "<ENUM Shutdown type>",
     "on_battery_delay": "<Integer>",
     "percent_battery_remaining":"<Integer>",
     "minutes_battery_remaining": "<Integer>"
  }
}

Success Response

Code: 200

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_actions"
  },
  "data" : {
    "type" : "shutdown_actions",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

Shutdown Method 

 

The Shutdown Method endpoint provides a GET and Update API for the Shutdown method. This API is supported only for PowerAlert Office/Home/Medical. It uses the following enums:

 

shutdown_method:
SHUTDOWN_METHOD_SHUTDOWN
SHUTDOWN_METHOD_HIBERNATE

 

 

GET Shutdown Home Method  

 

Title

GET Shutdown Method

URL

/api/shutdown_method

Method

GET

Success Response

{
   "meta":    {
     
   },
   "data":    {
      "type": "shutdown_method",
      "attributes":       {
         "shutdown_method": "<ENUM Shutdown Method>"

      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

Update Shutdown Home Method  

 

Title

Update Shutdown Method

URL

/api/shutdown_method

Method

PATCH

Data Params

{
  "data" : {

         "type": "shutdown_method"
    "attributes" :{

      "type": "shutdown_method",
      "attributes":{
         "shutdown_method": "<ENUM Shutdown Method>"

      }
   }

}

Success Response

Code: 200

{
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "/api/shutdown_method"
  },
  "data" : {
    "type" : "shutdown_method",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is supported only for PowerAlert Local

 

 

 

SMS Action

 

The SMS Action endpoint provides a CRUD API for SMS actions.  SMS Action has attributes ‘sms_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, sms will be sent to all sms contacts. If set to false, the ‘sms_contact’ field must contain one or more valid sms contact IDs.

 

GET SMS Action

 

Title

GET SMS Action

URL

/api/sms_actions

Method

GET

URL Params

Get SMS Action

/api/sms_actions/:actionId - By id (default)

or

/api/sms_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data": {

        "type" : "sms_actions",

        "id" : "1",

        "attributes": {

            "name": "smsaction",

            "key": 0,

            "delay": 30,

            "enabled": true,

            "trigger_events": [

                {

                    "id": "5",

                    "key": 0,

                    "name": "",

                     //ENUM EventSourceTYpe

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_id": 1,

                    "source_name": "Device0391",

                    "action_id": "11",

                    "action_name": "",

                    "fire_on_set": false,

                    "fire_on_clear": true

                }

            ],

            "interval": 0,

            "sms_contacts" : []

            "send_to_all": true,

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create SMS Action

 

Title

Create SMS Action

URL

/api/sms_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "sms_actions",

    "attributes" : {

      "sms_contact" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "enabled" : true,

      "send_to_all" : false,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "key" : 1,

      "name" : "anSmsActionName",

      "interval" : 0

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/sms_actions"

  },

  "data" : {

    "type" : "sms_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update SMS Action

 

Title

Update SMS Action

URL

/api/sms_actions

Method

PATCH

URL Params

PATCH SMS Action

/api/sms_actions/:actionId - By id (default)

or

/api/sms_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "sms_actions",

    "attributes" : {

      "sms_contact" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "enabled" : true,

      "send_to_all" : false,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : 0,

          "name" : "eventName",

          "fire_on_set" : true

        }

      ],

      "count" : 1,

      "delay" : 0,

      "key" : 1,

      "name" : "anSmsActionName",

      "interval" : 0

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/sms_actions"

  },

  "data" : {

    "type" : "sms_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP SET OID Action

 

The SNMP SET OID Action endpoint provides a CRUD API for SNMP OID actions.  SNMP OID Action has attributes ‘snmp_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, SNMP notifications will be sent to all SNMP contacts. If set to false, the ‘snmp_contact’ field must contain one or more valid SNMP contact IDs. It uses the following of enum:

 

data_type:

OID_DATA_TYPE_INTEGER
OID_DATA_TYPE_U_INTEGER32
OID_DATA_TYPE_OCTET_STRING

 

 

GET SNMP SET OID Action

 

Title

Get SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

GET

URL Params

/api/snmp_set_oid_actions/:actionId

or

/api/snmp_set_oid_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

Code: 200
Content {

    "meta": {

        "id": "92b2d8f3-49d2-4ae3-916e-70e0a6af8549",

        "constraints": {

          

        },

        "validation": [

          

        ]

    },

    "data":    {

      "type": "snmp_set_oid_actions",

      "id": "10",

      "attributes":       {

         "name": "anSnmpSetOidActionName",

         "key": 0,

         "delay": 0,

         "enabled": true,

         "trigger_events": [         {

            "id": "1",

            "key": 0,

            "name": "",

            "source_type": "EVENT_SOURCE_TYPE_DEVICE",

            "source_id": 1,

            "source_name": "",

            "action_id": "10",

            "action_name": "",

            "fire_on_set": true,

            "fire_on_clear": true

         }],

         "interval": 0,

         "count": 1,

         "send_to_all": false,

         "snmp_contact":          [

                        {

               "id": "1",

               "name": null

            },

                        {

               "id": "2",

               "name": null

            }

         ],

         "oid": "anoidvalue",

         "value": "avalue",

         "data_type": "DATA_TYPE_STRING"

      }

   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create SNMP SET OID Action

 

Title

Create SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

POST

Data Params

{

    "data": {

        "type": "snmp_set_oid_actions",

        "attributes": {

            "name": "anSnmpSetOidActionName",

            "key": 1,

            "delay": 0,

            "interval": 0,

            "count": 1,

            "enabled": true,

            "oid": "anoidvalue",

            "value": "avalue",

            "data_type": "DATA_TYPE_STRING",

            "send_to_all": false,

            "snmp_contact": [

                {"id": 1},

                {"id": 2}

            ],

            "trigger_events": [

                { "id": "1",

                  "name": "eventName",

                  "key": 40,

                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                  "source_id": 1,

                  "action_name": "",

                  "fire_on_set": true,

                  "fire_on_clear": true

                }

            ]

        }

    }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/snmp_set_oid_actions"

  },

  "data" : {

    "type" : "snmp_set_oid_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update an SNMP SET OID Action

 

Title

Update SNMP SET OID Action

URL

/api/snmp_set_oid_actions

Method

PATCH

URL Params

PATCH SNMP SET OID Action

/api/snmp_set_oid_actions/:actionId

or

/api/snmp_set_oid_actions/:actionName

 

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

    "data": {

        "type": "snmp_set_oid_actions",

        "attributes": {

            "name": "anSnmpSetOidActionName",

            "key": 1,

            "delay": 0,

            "interval": 0,

            "count": 1,

            "enabled": true,

            "oid": "anoidvalue",

            "value": "avalue",

            "data_type": "DATA_TYPE_STRING",

            "send_to_all": false,

            "snmp_contact": [

                {"id": 1},

                {"id": 2}

            ],

            "trigger_events": [

                { "id": "1",

                  "name": "eventName",

                  "key": 40,

                  "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                  "source_id": 1,

                  "action_name": "",

                  "fire_on_set": true,

                  "fire_on_clear": true

                }

            ]

        }

    }

}

Success Response

Code: 200
Content
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/snmp_set_oid_actions"

  },

  "data" : {

    "type" : "snmp_set_oid_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP Trap Action

 

The SNMP Trap Action endpoint provides a CRUD API for SNMP Trap actions.  SNMP Trap Action has attributes ‘snmp_contact’ and ‘send_to_all’. If ‘send_to_all’ is set to true, SNMP traps will be sent to all SNMP contacts. If set to false, the ‘snmp_contact’ field must contain one or more valid SNMP contact IDs or names.

 

GET an SNMP Trap Action

 

Title

GET SNMP Trap Action

URL

/api/trap_actions

Method

GET

URL Params

/api/trap_actions/:actionId

or

/api/trap_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

"data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : "1",

          "name" : "testname1"

        },

        {

          "id" : "2",

          "name" : "testname2"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        }

      ],

      "key" : 0,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create SNMP Trap Action

 

Title

Create SNMP Trap Action

URL

/api/trap_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "trap_actions",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : 1

        },

        {

          "id" : 2

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "key" : 1,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/trap_actions"

  },

  "data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update SNMP Trap Action

 

Title

Update SNMP Trap Action

URL

/api/trap_actions

Method

PATCH

URL Params

/api/trap_actions/:actionId

or

/api/trap_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "trap_actions",

    "attributes" : {

      "enabled" : true,

      "send_to_all" : false,

      "snmp_contacts" : [

        {

          "id" : 1,

          "name" : "testname1"

        },

        {

          "id" : 2,

          "name" : "testname2"

        }

      ],

      "count" : 1,

      "delay" : 0,

      "trigger_events" : [

        {

          "fire_on_clear" : true,

          "action_name" : "",

          "id" : "1",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "key" : 40,

          "source_id" : 1,

          "fire_on_set" : true,

          "name" : "eventName"

        }

      ],

      "key" : 1,

      "name" : "aTrapActionName2",

      "interval" : 0

    }

  }

}

Success Response

Code: 200
Content
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/trap_actions"

  },

  "data" : {

    "type" : "trap_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Turn Off Device Action

 

The Turn Off Device Action endpoint provides a CRUD API for Turn Off Device actions.  It requires a target device identity in the form of ‘device_name’ or ‘device_id’.

 

GET Turn off Device Action

 

Title

GET Turn Off Device Action

URL

/api/turn_off_device_actions

Method

GET

URL Params

/api/turn_off_device_actions/:actionId

or

/api/turn_off_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

{

"data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "device_identity" : {

        "device_name" : "",

        "device_id" : 0

      },

      "trigger_events" : [

        {

          "fire_on_clear" : false,

          "action_name" : "",

          "id" : "5",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        },

        {

          "fire_on_clear" : false,

          "action_name" : "",

          "id" : "9",

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "source_name" : "",

          "key" : 0,

          "source_id" : 1,

          "action_id" : "5",

          "name" : "",

          "fire_on_set" : true

        }

      ],

      "key" : 1284,

      "delay" : 120,

      "name" : "Default Device Shutdown",

      "enabled" : true

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create Turn Off Device Action

 

Title

Create Turn Off Device Action

URL

/api/turn_off_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "turn_off_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "aTurnOffDeviceActionName",

      "enabled" : true,

      "device_id" : 1

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_off_device_actions"

  },

  "data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Turn Off Device Action

 

Title

Update Turn Off Device Action

URL

/api/turn_off_device_actions

Method

PATCH

URL Params

/api/turn_off_device_actions/:actionId

or

/api/turn_off_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "turn_off_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "aTurnOffDeviceActionName",

      "device_id" : "1"

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_off_device_actions"

  },

  "data" : {

    "type" : "turn_off_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Turn On Device Action

 

The Turn On Device Action endpoint provides a CRUD API for Turn On Device actions.  It requires a device identity attribute in the form of ‘device_id’ or ‘device_name’.

 

GET Turn On Device Action

 

Title

GET Turn On Device Action

URL

/api/turn_on_device_actions

Method

GET

URL Params

/api/turn_on_device_actions/:actionId

or

/api/turn_on_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

{

"data": {

        "type": "turn_on_device_actions",

        "id": "5",

        "attributes": {

            "device_identity": {

                "device_name": "",

                "device_id": 0

            },

            "trigger_events": [

                {

                    "fire_on_clear": false,

                    "action_name": "",

                    "id": "5",

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_name": "",

                    "key": 0,

                    "source_id": 1,

                    "action_id": "5",

                    "name": "",

                    "fire_on_set": true

                },

                {

                    "fire_on_clear": false,

                    "action_name": "",

                    "id": "9",

                    "source_type": "EVENT_SOURCE_TYPE_DEVICE",

                    "source_name": "",

                    "key": 0,

                    "source_id": 1,

                    "action_id": "5",

                    "name": "",

                    "fire_on_set": true

                }

            ],

            "key": 1284,

            "delay": 120,

            "name": "Default Turn On Device",

            "enabled": true

        }

    }

}}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Turn On Device Action

 

Title

Create Turn On Device Action

URL

/api/turn_on_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "turn_on_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "aTurnOnDeviceActionName",

      "enabled" : true,

      "device_id" : 1

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update Turn On Device Action

 

Title

Update Turn On Device Action

URL

/api/turn_on_device_actions

Method

PATCH

URL Params

/api/turn_on_device_actions/:actionId

or

/api/turn_on_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "turn_on_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "aTurnOnDeviceActionName",

      "device_id" : "1"

    }

  }

}

Success Response

Code: 200
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Restart Device Action

 

The Restart Device Action endpoint provides a CRUD API for Restart Device actions.  It requires a device identity attribute in the form of ‘device_id’ or ‘device_name’. Shutdown and restart delays (in seconds) can be entered.

 

GET Restart Device Action

 

Title

GET Restart Device Action

URL

/api/restart_device_actions

Method

GET

URL Params

/api/restart_device_actions/:actionId

or

/api/restart_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to get action by name

Success Response

         {

       "meta": {

             "id": "6d28a089-21cf-4149-aba4-77fc58e0e2c2",

             "constraints": {

             },

             "validation": [

             ],

             "path": "/api/restart_device_actions/6"

       },

       "data": {

             "type": "restart_device_actions",

             "id": "6",

             "attributes": {

                    "name": "aTurnOnDeviceActionName",

                    "key": 0,

                    "delay": 1,

                    "enabled": true,

                    "trigger_events": [{

                          "id": "1",

                          "key": 0,

                          "name": "",

                          "source_type": "EVENT_SOURCE_TYPE_AUTOPROBE",

                          "source_id": 1,

                          "source_name": "Watchdog Ping",

                          "action_id": "6",

                          "action_name": "",

                          "fire_on_set": true,

                          "fire_on_clear": true

                    }],

                    "device_identity": {

                          "device_id": 1,

                          "device_name": "Device0391"

                    },

                    "shutdown_delay": 1,

                    "restart_delay": 2

             }

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Create Restart Device Action

 

Title

Create Restart Device Action

URL

/api/restart_device_actions

Method

POST

Data Params

{

  "data" : {

    "type" : "restart_device_actions ",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "key" : 1,

      "delay" : 0,

      "name" : "restartDevice",

      "enabled" : true,

      "device_id" : 1,

      "shutdown_delay": 1,

      "restart_delay": 2

    }

  }

}

Success Response

Code: 201
Content:
{

  "meta" : {

    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",

    "path" : "\/api\/turn_on_device_actions"

  },

  "data" : {

    "type" : "turn_on_device_actions",

    "id" : "5",

    "attributes" : {

      "response" : 0

    }

  }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Update Restart Device Action

 

Title

Update Restart Device Action

URL

/api/restart_device_actions

Method

PATCH

URL Params

/api/restart_device_actions/:actionId

or

/api/restart_device_actions/:actionName

Note: No HTTP header required to get action by id

http header "by: name" required to update action by name

Data Params

{

  "data" : {

    "type" : "restart_device_actions",

    "attributes" : {

      "trigger_events" : [

        {

          "id" : "1",

          "source_id" : 1,

          "source_type": "EVENT_SOURCE_TYPE_DEVICE",

          "fire_on_clear" : true,

          "fire_on_set" : true

        }

      ],

      "enabled" : true,

      "delay" : 1,

      "name" : "RestartDeviceName",

      "device_id" : "1",

      "shutdown_delay": 1,

      "restart_delay": 2

 

    }

  }

}

Success Response

Code: 200
Content:
{

  {
  "meta" : {
    "id" : "f2259364-ce69-44d2-8f95-1aa145c20fdb",
    "path" : "\/api\/restart_device_actions"
  },
  "data" : {
    "type" : "restart_device_actions",
    "id" : "5",
    "attributes" : {
      "response" : 0
    }
  }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Alarms

The Alarm API enables display of alerts for the device and any connected peripherals (e.g. sensors). An alarm is active if it has not been acknowledged, nor cleared. An alarm is cleared when the condition that triggered the alarm is no longer in effect. An alarm can be acknowledged in one of two ways: automatically (using event service) or manually. Alarm API enables manual acknowledgement of single or multiple alarms. The alarm data can also be sorted by Date/Time in descending or ascending order. It uses the following enums:

 

event_source_type:

 EVENT_SOURCE_TYPE_DEVICE

 EVENT_SOURCE_TYPE_AUTOPROBE

 EVENT_SOURCE_TYPE_SYSTEM

 

severity:

 EVENT_SEVERITY_EMERGENCY

 EVENT_SEVERITY_ALERT

 EVENT_SEVERITY_CRITICAL

 EVENT_SEVERITY_ERROR

 EVENT_SEVERITY_WARNING

 EVENT_SEVERITY_NOTICE

 EVENT_SEVERITY_INFORMATIONAL

 EVENT_SEVERITY_DEBUG

 

high_severity:

 ALARM_SEVERITY_LEVEL_NONE

 ALARM_SEVERITY_LEVEL_CRITICAL

 ALARM_SEVERITY_LEVEL_WARNING

 ALARM_SEVERITY_LEVEL_INFORMATIONAL

 

GET All Alarms

 

Title

GET All Alarms

URL

/api/alarms

Method

GET

URL Params

Filtering

·       'filter' query parameter is used for filtering:

       Field Equals to Value:

/api/alarms?filter=[{"name":"<field name>","op":"eq","val":<field value>}]

Example

filter=[{"name": "acknowledged","op": "eq","val": false}]

 

·       Checking for multiple value:

/api/alarms?filter=[{"name":"<field name>","op":"_in","val":[<field value1>,..., <field value N>] }]

Example: filter=[{"name": "severity","op": "in_","val": ["EVENT_SEVERITY_ERROR","EVENT_SEVERITY_WARNING","EVENT_SEVERITY_CRITICAL"]}

 

·       Timestamp Range:

/api/alarms?filter=[{"name":"occurred_time","op":"ge","val": "YYYY-MM-DDTHH:mm:ss-00:00"}, {"name":"occurred_time","op":"le","val": "YYYY-MM-DDTHH:mm:ss-00:00"}] 

Example filter=[{"name": "occurred_time","op": "range","val": ["2019-06-06T15:38:54-05:00","2019-06-09T15:38:54-05:00"]}]

·       Timestamp from Date Time:

/api/alarms?filter=[{"name":"occurred_time","op":"ge","val":"YYYY-MM-DDTHH:mm:ss-00:00"}]

Example: filter=[{"name": "occurred_time","op": "ge","val": "2019-05-06T15:38:54-05:00"}]

·       Timestamp till Date Time:

/api/alarms?filter=[{"name":"occurred_time","op":"le","val": "YYYY-MM-DDTHH:mm:ss-00:00"}]

Example: filter=[{"name": "occurred_time","op": "le","val": "2019-05-06T15:38:54-05:00"}]

 

Sorting

·       'sort' query parameter is used for sorting:

/api/alarms?sort=<fieldname>

·       Descendant Sort:

/api/alarms?sort=-<fieldname>

Example : sort in descendant order based on alarm occurred time

/api/alarms?sort=-occurred_time

·       Multiple Sort:

/api/alarms?sort=<fieldname1>, <fieldname2>

·       Multiple + Descendant Sort:

/api/alarms?sort=<fieldname1>, -<fieldname2>

 

Pagination

/api/alarms?page[size]=<page size>&page[number]=<page number>

 

Default:

page size = 30

page number = 1

 

Examples:

·       ID Range Filter

/api/alarms?id[from]=<from id>&id[tp]=<to id>

Example /api/alarms?id[from]=1&id[to]=10

·       Combination Example

http://127.0.0.1:3001/api/alarms?filter=[{"name": "severity","op": "in_","val": ["EVENT_SEVERITY_ERROR","EVENT_SEVERITY_WARNING","EVENT_SEVERITY_CRITICAL"]},{"name":"source_name","op":"in_","val":["Sensor0014","Device0001"]}]&sort=-occurred_time&page[size]=5&page[number]=1

·       Get all cleared alarms

http://127.0.0.1:3001/api/alarms?page[size]=5&page[number]=1&filter=[{"name": "cleared","op": "eq","val": true}]

·       Get all acknowledged alarms

http://127.0.0.1:3001/api/alarms?page[number]=1&filter=[{"name": "acknowledged","op": "eq","val": true}]

Success Response

Code: 200 

Content: 

{
    "meta": {
        "id": "<request id>",
        "constraints": {
            "max_items": < integer : total number of alarms record>,
            "min_items": 0,
            "editable_attributes": [],
            "required_attributes": [],
            "delete_allowed": true
        },
        "validation": [{
                "attribute": "event_key",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "integer"
            },
            {
                "attribute": "event_source_type",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [
                    "EVENT_SOURCE_TYPE_DEVICE",
                    "EVENT_SOURCE_TYPE_AUTOPROBE",
                    "EVENT_SOURCE_TYPE_SYSTEM"
                ],
                "type": "enum"
            },
            {
                "attribute": "source_name",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "string"
            },
            {
                "attribute": "severity",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [
                    "EVENT_SEVERITY_EMERGENCY",
                    "EVENT_SEVERITY_ALERT",
                    "EVENT_SEVERITY_CRITICAL",
                    "EVENT_SEVERITY_ERROR",
                    "EVENT_SEVERITY_WARNING",
                    "EVENT_SEVERITY_NOTICE",
                    "EVENT_SEVERITY_INFORMATIONAL",
                    "EVENT_SEVERITY_DEBUG"
                ],
                "type": "enum"
            },
            {
                "attribute": "detail",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "string"
            },
            {
                "attribute": "occurred_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "cleared_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "cleared",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            },
            {
                "attribute": "acknowledged",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            },
            {
                "attribute": "acknowledged_time",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "datetime"
            },
            {
                "attribute": "localize",
                "maximum": 0,
                "minimum": 0,
                "multiple_of": 0,
                "min_length": 0,
                "max_length": 0,
                "pattern": "",
                "enum": [],
                "type": "boolean"
            }
        ],
        "count": <integer : total number of alarm count or record>,
        "path": "/api/alarms"
    },
    "links": {
        "self": "http://<serverip>/api/alarms?page%5Bsize%5D=30&page%5Bnumber%5D=1"
    },
    "data": [{
        "type": "alarms",
        "id": <alarm id>,
        "attributes": {
            "event_source_type": "Enum EVENT SOURCE TYPE",
            "source_name": "<String>",
            "severity": "ENUM EVENT SEVERITY",
            "detail": "<String>",
            "occured_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "cleared_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged": <boolean>,
            "cleared": <boolean>,
            "localize": <boolean>
        }
    }]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One Alarm

 

Title

GET One Alarm

URL

/api/alarms/:id

Method

GET

Success Response

Code: 200 

Content:

{

    "meta": {

        "id": "request id",

        "constraints": {},

        "validation": [

            {

                "attribute": "event_key",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "event_source_type",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SOURCE_TYPE_DEVICE",

                    "EVENT_SOURCE_TYPE_AUTOPROBE",

                    "EVENT_SOURCE_TYPE_SYSTEM"

                ],

                "type": "enum"

            },

            {

                "attribute": "source_name",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "EVENT_SEVERITY_EMERGENCY",

                    "EVENT_SEVERITY_ALERT",

                    "EVENT_SEVERITY_CRITICAL",

                    "EVENT_SEVERITY_ERROR",

                    "EVENT_SEVERITY_WARNING",

                    "EVENT_SEVERITY_NOTICE",

                    "EVENT_SEVERITY_INFORMATIONAL",

                    "EVENT_SEVERITY_DEBUG"

                ],

                "type": "enum"

            },

            {

                "attribute": "detail",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "string"

            },

            {

                "attribute": "occurred_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "cleared_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "cleared",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "acknowledged",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            },

            {

                "attribute": "acknowledged_time",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "datetime"

            },

            {

                "attribute": "localize",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "boolean"

            }

        ],

        "path": "/api/alarms/5"

    },

    "data": {

        "type": "alarms",
        "id": <alarm id>,
        "attributes": {
            "event_source_type": "Enum EVENT SOURCE TYPE",
            "source_name": "<String>",
            "severity": "ENUM EVENT SEVERITY",
            "detail": "<String>",
            "occurred_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "cleared_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged_time": "datetime, in format of YYYY-MM-DDTHH:mm:ss+00:00 - Example 2019-05-06T14:39:35-05:00",
            "acknowledged": <boolean>,
            "cleared": <boolean>,
            "localize": <boolean>

       }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Acknowledge Alarms

 

Title

Acknowledge Alarms

URL

/api/alarms/acknowledge

Method

PATCH

URL Params

Data Params

{
  "data": [
    { "type": "alarms", "id": "<string, alarms id>" },
    { "type": "alarms", "id": "<string, alarms id>" }
  ]
}

Success Response

Code: 200
Content: {  
   "meta":{  
      "id":
"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         }
      ]
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Acknowledge All Alarms

 

Title

Acknowledge All Alarms

URL

/api/alarms/acknowledge/all

Method

PATCH

Success Response

Code: 200
Content: {  
   "meta":{  
      "id":
"<request id>"
   },
   "data":{  
      "data":[  
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         },
         {  
            "type":
"alarms",
            "id":
"<string, alarm id>"
         }
      ]
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

GET Alarm Summary

 

Title

GET Alarm Summary

URL

/api/alarms/acknowledge/all

Method

GET

Success Response

Code: 200
Content:

{

    "meta": {

        "id": "ceac87cb-5753-426b-a665-647551f02b2e",

        "constraints": {},

        "validation": [

            {

                "attribute": "critical_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "warning_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "informational_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "total_alarm_count",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [],

                "type": "integer"

            },

            {

                "attribute": "high_severity",

                "maximum": 0,

                "minimum": 0,

                "multiple_of": 0,

                "min_length": 0,

                "max_length": 0,

                "pattern": "",

                "enum": [

                    "ALARM_SEVERITY_LEVEL_NONE",

                    "ALARM_SEVERITY_LEVEL_CRITICAL",

                    "ALARM_SEVERITY_LEVEL_WARNING",

                    "ALARM_SEVERITY_LEVEL_INFORMATIONAL"

                ],

                "type": "enum"

            }

        ],

        "path": "/api/alarms/summary"

    },

    "data": {

        "type": "alarms",

        "attributes": {

            "critical_alarm_count": <int>

            "warning_alarm_count": <int>,

            "informational_alarm_count": <int>,

            "total_alarm_count": <int>,

            "high_severity": "Enum ALARM SEVERITY"

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

Authentication (Login & Logout)

PowerAlert uses an OAuth 2.0 token-based authentication model. Under this model, a user calls POST /api/outh/token to request access token. An access token is returned if the credential passed in the POST request is valid. An access token passed in the headers of each subsequent request and used to determine if the user is authorized to perform the operation. Token request (login), refresh token and logout are separate API each of them explained in detail below.

 

Login (Token) Request

An authentication token is required to interact with PowerAlert APIs. Once obtained, this token must appear in the HTTP header of any subsequent requent. 

HEADERS

Authorization Bearer {access_token}

 

 

Title

Login

URL

/api/oauth/token

Method

POST

Data Params

{

    "username":"localadmin",

    "password":"localadmin",

    "grant_type": "password"

}

Success Response

Code: 200
Content:

 

{

    "access_token": "<string>",

    "msg": "Logged in as localadmin",

    "refresh_token": "<String>"

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

Refresh Token

 

Title

Refresh Token

URL

/api/oauth/token/refresh

Method

POST

URL Params

HTTP Header required:

Authorization: Bearer {refresh_token}

Where refresh_token comes from login request

Success Response

Code: 200
Content:

 

{

    "access_token": "<string>",

    "msg": "Logged in as localadmin",

    "refresh_token": "<String>"

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

 

Logout (Invalidate Access Token)

 

Title

Logout  

URL

/api/oauth/token/logout

Method

POST

URL Params

HTTP Header required:

Authorization: Bearer {refresh_token}

Where refresh_token comes from login request

Success Response

Code: 200
Content:

{}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

Return empty array if there is no alarm to acknowledge

 

 

Alert Contact

The Alert Contact API enables creation, editing and deletion of alert notification recipients. Three types of alert contact can be created: Email, SMS and SNMP. For testing each type of alert contact, use the following enums:

 

last_test_status:

TEST_STATUS_UNSPECIFIED

TEST_STATUS_NONE

TEST_STATUS_SUCCESS   are these the right enums for Alert Contaxt?

TEST_STATUS_FAIL

 

 

Email Contact

 

The Email Contact API enables creating, editing, deleting and testing email notification recipients.

 

 

GET All Email Contacts

 

Title

GET All Email Contacts

URL

/api/email_contacts

Method

GET

URL Params

Data Params

Success Response

Code: 200 
Content: {  
   "meta": {
    "id": "<string>",
    "constraints": {
    "max_items": 64,
    "min_items": 0,
    "editable_attributes": [
    "name",
    "email",
    "status"
    ],
    "required_attributes": [
    "name",
    "email",
    "status"
    ],
    "delete_allowed": true
   },
    "validation": [
    {
    "attribute": "name",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "email",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 128,
    "pattern": "[^@]+@[^@]+\\.[^@]+",
    "enum": [],
    "type": "email"
    },
    {
    "attribute": "status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
    "type": "boolean"
    },
    {
    "attribute": "last_test_status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [
    "TEST_STATUS_NONE",
    "TEST_STATUS_SUCCESS",
    "TEST_STATUS_FAIL"
    ],
    "type": "enum"
    },
    {
    "attribute": "last_test_message",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "last_test_timestamp",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
     "type": "datetime"
    }
    ]
   },
   "data":[  
      {  
         "type":"email_contacts",
         "id":"<string>",
         "attributes":{  
            "name":"<string>",
            "email":"<string>",
            "status":<boolean>
         }
      },
      {  
         "type":"email_contacts",
         "id":"<string>",
         "attributes":{  
            "name":"<string>",
            "email":"<string>",
            "status":<boolean>,
            "last_test_message": "<string>",
            "last_test_status": "<enum, TestStatus>",
            "last_test_timestamp": "<timestamp>"
         }
      }
   ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One Email Contact

 

Title

Get One Email Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

GET

URL Params

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content: 
{  
  "meta": {
    "id": "<id>",
    "constraints": {
    "max_items": 64,
    "min_items": 0,
    "editable_attributes": [
    "name",
    "email",
    "status"
    ],
    "required_attributes": [
    "name",
    "email",
    "status"
    ],
    "delete_allowed": true
   },
    "validation": [
    {
    "attribute": "name",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "email",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 1,
    "max_length": 128,
    "pattern": "[^@]+@[^@]+\\.[^@]+",
    "enum": [],
    "type": "email"
    },
    {
    "attribute": "status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
    "type": "boolean"
    },
    {
    "attribute": "last_test_status",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [
    "TEST_STATUS_NONE",
    "TEST_STATUS_SUCCESS",
    "TEST_STATUS_FAIL"
    ],
    "type": "enum"
    },
    {
    "attribute": "last_test_message",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 64,
    "pattern": "",
    "enum": [],
    "type": "string"
    },
    {
    "attribute": "last_test_timestamp",
    "maximum": 0,
    "minimum": 0,
    "multiple_of": 0,
    "min_length": 0,
    "max_length": 0,
    "pattern": "",
    "enum": [],
     "type": "datetime"
    }
    ]
   },
   "data":{  
      "type":"email_contacts",
      "id":"<string>",
      "attributes":{  
         "name":"<string>",
         "email":"<string>",
         "status":"<boolean>",
         "last_test_message": "<string>",
         "last_test_status": "<enum, TestStatus>",
         "last_test_timestamp": "<timestamp>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create Email Contact

 

Title

Create Email Contact

URL

/api/email_contacts

Method

POST

Data Params

{
 "data": {
 "type": "email_contacts",
 "attributes": {
 "name": "<string>",
 "email": "<string>",
 "status": "<boolean>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"

 }
 }
}

Success Response

Code: 201 
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "email_contacts",
 "id": "<string>",
 "attributes": {
 "name": "<string>",
 "email": "<string>",
 "status": "<boolean>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"

 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Delete Email Contact

 

Title

Delete Email Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

PATCH

URL Params

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"email_contacts",
      "id":"<string, deleted contact id>",
      "attributes":{  
         "response":0
      }
   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

 

Test Email Contact

 

Title

Test Email Contact

URL

/api/email_contacts/test

Method

POST

Data Params

{
 "data": {
 "type": "email_contacts",
 "id": "<string, optional for testing by id>",
 "attributes": {
 "email": "<string>",
 "name": <string, optional for testing by name>
 }
 }
}

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "email_contacts",
 "id": "<string>",
 "attributes": {
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>",
 "status": "<enum, TestStatus>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SMS Contact

 

The SMS Contact API enables creating, editing, deleting and testing SMS notification recipients.

 

 

GET All SMS Contacts

 

Title

GET All SMS Contacts

URL

/api/sms_contacts

Method

GET

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<id>",
 "constraints": {
 "max_items": 64,
 "min_items": 0,
 "editable_attributes": [
 "name",
 "phone",
 "status"
 ],
 "required_attributes": [
 "name",
 "phone",
 "status"
 ],
 "delete_allowed": true
 },
 "validation": [
 {
 "attribute": "name",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 1,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "phone",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 6,
 "max_length": 32,
 "pattern": "^[\\d\\(\\)\\+\\-]+$",
 "enum": [
 
 ],
 "type": "phone"
 },
 {
 "attribute": "provider",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "alltel",
 "att",
 "boost_mobile",
 "consumer_cellular",
 "cricket",
 "c_spire",
 "google_fi",
 "metro_pcs",
 "page_plus",
 "republic_wireless",
 "sprint",
 "ting",
 "tmobile",
 "tracfone",
 "us_cellular",
 "verizon",
 "virgin_mobile",
 "xfinity_mobile",
 "custom"
 ],
 "type": "enum"
 },
 {
 "attribute": "custom_email",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 128,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "boolean"
 },
 {
 "attribute": "last_test_status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "TEST_STATUS_NOT_TESTED",
 "TEST_STATUS_SUCCESS",
 "TEST_STATUS_FAIL"
 ],
 "type": "enum"
 },
 {
 "attribute": "last_test_message",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "last_test_timestamp",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "datetime"
 }
 ]
 },
 "data": [
 {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "status": <boolean>,
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": <enum, TestStatus>,
 "last_test_message": "<string>",
 "last_test_timestamp": <number>
 }
 }
 ]
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

GET One SMS Contact

 

Title

GET One SMS Contact

URL

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Method

GET

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content:
{
 "meta": {
 "id": "<string>",
 "constraints": {
 "max_items": 64,
 "min_items": 0,
 "editable_attributes": [
 "name",
 "phone",
 "status"
 ],
 "required_attributes": [
 "name",
 "phone",
 "status"
 ],
 "delete_allowed": true
 },
 "validation": [
 {
 "attribute": "name",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 1,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "phone",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 6,
 "max_length": 32,
 "pattern": "^[\\d\\(\\)\\+\\-]+$",
 "enum": [
 
 ],
 "type": "phone"
 },
 {
 "attribute": "provider",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "alltel",
 "att",
 "boost_mobile",
 "consumer_cellular",
 "cricket",
 "c_spire",
 "google_fi",
 "metro_pcs",
 "page_plus",
 "republic_wireless",
 "sprint",
 "ting",
 "tmobile",
 "tracfone",
 "us_cellular",
 "verizon",
 "virgin_mobile",
 "xfinity_mobile",
 "custom"
 ],
 "type": "enum"
 },
 {
 "attribute": "custom_email",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 128,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "boolean"
 },
 {
 "attribute": "last_test_status",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 "TEST_STATUS_NOT_TESTED",
 "TEST_STATUS_SUCCESS",
 "TEST_STATUS_FAIL"
 ],
 "type": "enum"
 },
 {
 "attribute": "last_test_message",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 64,
 "pattern": "",
 "enum": [
 
 ],
 "type": "string"
 },
 {
 "attribute": "last_test_timestamp",
 "maximum": 0,
 "minimum": 0,
 "multiple_of": 0,
 "min_length": 0,
 "max_length": 0,
 "pattern": "",
 "enum": [
 
 ],
 "type": "datetime"
 }
 ]
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "provider": "<string>",
 "custom_email": "<string>",
 "status": <boolean>,
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 },
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create SMS Contact

 

Title

Create SMS Contact

URL

/api/sms_contacts

Method

POST

Data Params

{
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Success Response

Code: 201 
Content:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "uid": "<string>",
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_message": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Delete SMS Contact

 

Title

Delete SMS Contact

URL

/api/email_contacts/:contactId or

/api/email_contacts/:contactName

Method

DELETE

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "response": 0
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SMS Contact

 

Title

Update SMS Contact

URL

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Method

PATCH

URL Params

/api/sms_contacts/:contactId or

/api/sms_contacts/:contactName

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Data Params

{
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "name": "<string>",
 "phone": "<string>",
 "status": "<boolean>",
 "provider": "<string>",
 "custom_email": "<string>",
 "last_test_status": "<enum, TestStatus>",
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>"
 }
 }
}

Success Response

Code: 200
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "id": "<string>",
 "attributes": {
 "response": 0
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET All SMS Providers

 

Title

GET All SMS Providers

URL

/api/sms_providers

Method

GET

Success Response

Code: 200 
Content:  
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_providers",
 "attributes": {
   "<key>": "<carrier>",
   "<key>": "<carrier>"
   ...
   }
 }
}

Example:

{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_providers",
 "attributes": {
   "alltel": "Alltel",
   "att": "AT&T",
   "boost_mobile": "Boost Mobile",
   "c_spire": "C-Spire",
   "consumer_cellular": "Consumer Cellular",
   "cricket": "Cricket",
   "custom": "Other",
   "google_fi": "Google Fi",
   "metro_pcs": "Metro PCS",
   "page_plus": "Page Plus",
   "republic_wireless": "Republic Wireless",
   "sprint": "Sprint",
   "ting": "Ting",
   "tmobile": "T-Mobile",
   "tracfone": "Tracfone",
   "us_cellular": "U.S. Cellular",
   "verizon": "Verizon",
   "virgin_mobile": "Virgin Mobile",
   "xfinity_mobile": "XFinity Mobile"
   }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Test SMS Contact

 

Title

Test SMS Contact

URL

/api/sms_contacts/test

Method

POST

Data Params

{
 "data": {
 "type": "sms_contacts",
 "id": "<string, optional for testing by id>",
 "attributes": {
 "name": "<string, optional for testing by name>",
 "phone": "<string>",
 "provider": "<string>",
 "status": <boolean>
 }
 }
}

Success Response

Code: 200
Content:
{
 "meta": {
 "id": "<request id>"
 },
 "data": {
 "type": "sms_contacts",
 "attributes": {
 "last_test_message": "<string>",
 "last_test_timestamp": "<timestamp>",
 "status": "<enum, TestStatus>"
 }
 }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

SNMP Contact

 

The SNMP Contact API enables creating, editing, deleting and testing SNMP notification recipients. It uses the following enums:

 

snmp_version:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V3

 

notification_type:

NOTIFICATION_TYPE_TRAP

NOTIFICATION_TYPE_INFORM

 

last_test_status:

TEST_STATUS_SUCCESS

TEST_STATUS_FAIL

TEST_STATUS_NONE

 

privacy_mode:

SNMPV3_AUTH_NO_AUTH_NO_PRIV

SNMPV3_AUTH_AUTH_NOPRIV

SNMPV3_AUTH_AUTH_PRIV

 

auth_proto:

SNMPV3_AUTH_PROTO_MD5

SNMPV3_AUTH_PROTO_SHA

 

priv_proto:

SNMPV3_PRIV_PROTO_DES

SNMPV3_PRIV_PROTO_AES

 

 

GET All SNMP Contacts

 

Title

GET All SNMP Contacts

URL

/api/snmp_contacts?snmpVersion=:snmpVersion

Method

GET

URL Params

Optional:

snmpVersion=<enum, snmp version>

example: snmpVersion=SNMP_PROTOCOL_V1

If empty, all snmp users, of all versions are returned

Success Response

Code: 200 
Content:

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "status",
            "ip_address",
            "trap_port",
            "set_port",
            "snmp_version",
            "notification_type",
            "trap_enabled",
            "set_enabled",
            "community",
            "user_name",
            "privacy_mode",
            "auth_proto",
            "authentication_pass_phrase",
            "priv_proto",
            "privacy_pass_phrase",
            "engine_id",

 "test_result_trap",

 "test_result_set"

         ],
         "required_attributes":[  
            "name",
            "ip_address",
            "trap_port",
            "set_port",
            "community",
            "user_name",
            "authentication_pass_phrase",
            "privacy_pass_phrase"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ip_address",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"ip"
         },
         {  
            "attribute":"trap_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"set_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"snmp_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMP_PROTOCOL_V1",
               "SNMP_PROTOCOL_V2",
               "SNMP_PROTOCOL_V3"
            ],
            "type":"enum"
         },
         {  
            "attribute":"notification_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "NOTIFICATION_TYPE_TRAP",
               "NOTIFICATION_TYPE_INFORM"
            ],
            "type":"enum"
         },
         {  
            "attribute":"trap_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"set_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"last_test_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "TEST_STATUS_NONE",
               "TEST_STATUS_SUCCESS",
               "TEST_STATUS_FAIL"
            ],
            "type":"enum"
         },
         {  
            "attribute":"last_test_message",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"last_test_timestamp",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"datetime"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"user_name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"privacy_mode",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_AUTH_NO_AUTH_NO_PRIV",
               "SNMPV3_AUTH_AUTH_NOPRIV",
               "SNMPV3_AUTH_AUTH_PRIV"
            ],
            "type":"enum"
         },
         {  
            "attribute":"auth_proto",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_AUTH_PROTO_MD5",
               "SNMPV3_AUTH_PROTO_SHA"
            ],
            "type":"enum"
         },
         {  
            "attribute":"authentication_pass_phrase",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"priv_proto",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMPV3_PRIV_PROTO_DES",
               "SNMPV3_PRIV_PROTO_AES"
            ],
            "type":"enum"
         },
         {  
            "attribute":"privacy_pass_phrase",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"engine_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":5,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":[  

// v1/v2c contact:
      {  
         "type":"snmp_contacts",
         "id":"<string>",
         "attributes":{  
            "uid":"<string>",
            "name":"<string>",
            "status":"<boolean>",
            "ip_address":"<string>",
            "trap_port":"<uint32>",
            "set_port":"<uint32>",
            "snmp_version":"<enum, snmp version>",
            "trap_enabled":"<true/false>",
            "set_enabled":"<true/false>",         
            "notification_type":"<enum, notification type>",
            "last_test_trap_status":"<enum, test status>",
            "last_test_trap_message":"<string>",

            "last_test_trap_timestamp":"<number in seconds>",
            "last_test_set_status": "<enum, test status>",
            "last_test_set_message": "<string>",
            "last_test_set_timestamp": "<number in seconds>",

            "community":""
         }
      },

// v3 contact
      {  
         "type":"snmp_contacts",
         "id":"<string>",
         "attributes":{  
            "uid":"<string>",
            "name":"<string>",
            "status":"<boolean>",
            "ip_address":"<string>",
            "trap_port":"<uint32>",
            "set_port":"<uint32>",
            "snmp_version":"<enum, snmp version>",
            "trap_enabled":"<true/false>",
            "set_enabled":"<true/false>",           
            "notification_type":"<enum, notification type>",         

            "last_test_trap_status":"<enum, test status>",
            "last_test_trap_message":"<string>",
            "last_test_trap_timestamp":"<number in seconds>",
            "last_test_set_status": "<enum, test status>",
            "last_test_set_message": "<string>",
            "last_test_set_timestamp": "<number in seconds>",

            "user_name":"<string>",
            "authentication_pass_phrase":"<string>",
            "privacy_pass_phrase":"<string>",
            "engine_id":"<string>",
            "privacy_mode":"<enum, privacy mode>",
            "auth_proto":"<enum, auth proto>",
            "priv_proto":"<enum, priv proto>"
         }
      }
   ]
}

Sample Call

curl -i

-H "Accept: application/vnd.api+json"

http://localhost:3001/api/snmp_contacts?snmpVersion=v1

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is used for SNMP v1, v2c, and v3 variants.

 

GET One SNMP Contact

 

Title

GET One SNMP Contact

URL

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Method

GET

URL Params

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Success Response

Code: 200 
Content:

{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "status",
            "ip_address",
            "trap_port",
            "set_port",
            "snmp_version",
            "notification_type",
            "trap_enabled",
            "set_enabled",
            "community",

            "test_result_trap",

            "test_result_set"
         ],
         "required_attributes":[  
            "name",
            "ip_address",
            "trap_port",
            "set_port",
            "community"
         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ip_address",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"ip"
         },
         {  
            "attribute":"trap_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"set_port",
            "maximum":65535,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"snmp_version",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "SNMP_PROTOCOL_V1",
               "SNMP_PROTOCOL_V2",
               "SNMP_PROTOCOL_V3"
            ],
            "type":"enum"
         },
         {  
            "attribute":"notification_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "NOTIFICATION_TYPE_TRAP",
               "NOTIFICATION_TYPE_INFORM"
            ],
            "type":"enum"
         },
         {  
            "attribute":"trap_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"set_enabled",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"last_test_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "TEST_STATUS_NONE",
               "TEST_STATUS_SUCCESS",
               "TEST_STATUS_FAIL"
            ],
            "type":"enum"
         },
         {  
            "attribute":"last_test_message",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"last_test_timestamp",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"datetime"
         },
         {  
            "attribute":"community",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         }
      ]
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<string>",
      "attributes":{  
         "uid":"<string>",
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",        
         "notification_type":"<enum, notification type>",      
         "community":"",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"

      }
   }
}

Sample Call

curl -i

-H "Accept: application/vnd.api+json"

http://localhost:3001/api/snmp_contacts/123

http://localhost:3001/api/snmp_contacts/somecontactname

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Create SNMP contact

 

Title

Create SNMP Contact

URL

/api/snmp_contacts

Method

POST

Data Params

 {  
   "data":{  
      "type":"snmp_contacts",
      "attributes":{  
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",        
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"      

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<string, snmp contact id>",
      "attributes":{  
         "uid":"<string, snmp contact id>",
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",         
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"       

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

This API is used for SNMP v1, v2c, and v3 variants.

 

 

 

Delete SNMP Contact

 

Title

Delete SNMP Contact

URL

/api/snmp_contacts/:contactId  or

/api/snmp_contacts/:contactName

Method

DELETE

URL Params

/api/snmp_contacts/:contactId  or

/api/snmp_contacts/:contactName

Note: No HTTP header required to delete by id

http header "by: name" required to delete by name

Success Response

Code: 200 
Content:

{  
   "data":{  
      "type":"snmp_contacts",
      "id":"<deleted contact id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update SNMP Contact

 

Title

Update SNMP Contact

URL

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Method

PATCH

URL Params

/api/snmp_contacts/:contactId or

/api/snmp_contacts/:contactName

Note: No HTTP header required to update by id

http header "by: name" required to update by name

Data Params

 {  
   "data":{  
      "type":"snmp_contacts",
      "attributes":{  
         "name":"<string>",
         "status":"<boolean>",
         "ip_address":"<string>",
         "trap_port":"<uint32>",
         "set_port":"<uint32>",
         "snmp_version":"<enum, snmp version>",
         "trap_enabled":"<boolean>",
         "set_enabled":"<boolean>",         
         "notification_type":"<enum, notification type>",

         "last_test_trap_status": "<enum test status>",
         "last_test_trap_message": "<string>",
         "last_test_trap_timestamp": "<number in seconds>",
         "last_test_set_status": "<enum test status>",
         "last_test_set_message": "<string>",
         "last_test_set_timestamp": "<number in seconds>"         

// for v1/v2c only:
         "community":"<string>",

// for v3 only:
         "user_name":"<string>",
         "authentication_pass_phrase":"<string>",
         "privacy_pass_phrase":"<string>",
         "engine_id":"<string>",
         "privacy_mode":"<enum, privacy mode>",
         "auth_proto":"<enum, auth proto>",
         "priv_proto":"<enum, priv proto>"
      }
   }
}

 

Success Response

Code: 200
Content:
{  
   "data":{  
      "type":"snmp_contacts",
      "id":"<string, updated contact id>",
      "attributes":{  
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Test SNMP Contact

 

Title

Test SNMP Contact

URL

/api/snmp_contacts/traptest

Method

POST

Data Params

{  
   "data":{  

      "type":"snmp_contacts_traptest",

 "id": "<contact id>"
      "attributes":{          
         "contact":{

            "<snmp contact>"        

      }

 }
   }
}

see notes below for details on contact attribute

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<contact id>",
      "attributes":{         
      "status": "<enum TestStatus>",

      "message": "<string>",

      "timestamp": "<number>"
      
}
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Test SNMP Contact (Set Port Test)

 

Title

Test SNMP Contact

URL

/api/snmp_contacts/settest

Method

POST

Data Params

{  
   "data":{  

      "type":"snmp_contacts",

       "id": "<contact id>"
      "attributes":{          
         "contact":"<snmp contact>" ,

          "oid": "<oid string>",

          "oid_data_type": <one of: "

          "oid_value": "<string>"       
      }
   }
}

see notes below for details on contact attribute

Success Response

Code: 201 
Content:

{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"snmp_contacts",
      "id":"<contact id>",
      "attributes":{         
         "status": "<enum TestStatus>",

         "message": "<string>",

         "timestamp": "<number>" 
      
}
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

NOTE

·       In Data Params, id field in data is required for an existing snmp contact only. id field is in the response only for an existing snmp contact as well

·       Also in Data Params, the <snmp contact> field is as it is defined in the 'Update one SNMP Contact' section above as shown in "data": {
"attributes": {<snmp contact> }
}

·       This Trap Port Test section is relevant for SNMP v1, v2, and v3

 

AutoProbes

The AutoProbes API enables management of AutoProbes, which automatically execute a prescribed action when the device loses network communication with specified target device.  This API is used for creating, editing and deleting AutoProbes. It uses the following enums:

 

probe_type:

AUTOPROBE_TYPE_NTP

AUTOPROBE_TYPE_PING

AUTOPROBE_TYPE_SNMP

 

probe_status:

AUTOPROBE_STATUS_UNSPECIFIED

AUTOPROBE_STATUS_UNKNOWN

AUTOPROBE_STATUS_OK

AUTOPROBE_STATUS_FAILED

AUTOPROBE_STATUS_FAILED_INIT

    

snmp_version:

SNMP_PROTOCOL_V1

SNMP_PROTOCOL_V2

SNMP_PROTOCOL_V

    

auth_proto:

SNMPV3_AUTH_PROTO_MD5

SNMPV3_AUTH_PROTO_SHA

    

priv_proto:

SNMPV3_PRIV_PROTO_DES

SNMPV3_PRIV_PROTO_AES

 

privacy_mode:

SNMPV3_AUTH_NO_AUTH_NO_PRIV

SNMPV3_AUTH_AUTH_NOPRIV

SNMPV3_AUTH_AUTH_PRIV

 

 

GET All AutoProbe Settings

 

Title

GET All AutoProbe Settings

URL

/api/autoprobe

Method

GET

URL Params

additive filters supported by status, probe_type, probe_status

 

GET all AutoProbe Entries by probe_type

/api/autoprobe?filter[probe_type]=AUTOPROBE_TYPE_SNMP

 

GET all AutoProbe Entries by status

/api/autoprobe?filter[status]=true

 

GET all AutoProbe Entries by probe_status

/api/autoprobe?filter[probe_status]=AUTOPROBE_STATUS_FAILED_INIT

 

GET all AutoProbe Entries by status, probe_type, probe_status

/api/autoprobe?filter[status]=true&filter[probe_type]

=AUTOPROBE_TYPE_SNMP&filter[probe_status]=AUTOPROBE_STATUS_FAILED_INIT

Success Response

Code: 200 

Content: {

    "meta": {

        "id": "c5e3d122-f41b-4caf-b520-56316ae4c199",

        "constraints": {}

        "validation": [],

        "count": 64,

        "path": "/api/autoprobe"

    },

    "data": [{

        "type": "autoprobe",

        "id": "3",

        "attributes": {

            "name": "<string>",

            "status": <boolean>,

            "description": "<string?",

            "probe_type": "<Enum>",

            "retries": <int>

            "interval": <int>

            "primary_address": "<String>",

            "primary_port": <int>,

            "secondary_address": "<string>",

            "secondary_port": <int>,

            "probe_status": "<Enum>",

            "snmp_security": {

                "snmp_version": "<Enum>",

                "community": "<String>",

                "user_name": "<String>",

                "privacy_mode": "<Enum>",

                "auth_proto": "<Enum>",

                "authentication_pass_phrase": "<String>",

                "priv_proto": "<Enum>",

                "privacy_pass_phrase": "<String>",

                "primary_oid": "<String>",

                "secondary_oid": "<String>"

            }

        }

    }}

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One AutoProbe Setting

 

Title

GET One AutoProbe Setting

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

 

Note: NO HTTP header required to get autoprobe by ID

Method

GET

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[string]

example: 'autoprobe1'

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "c5e3d122-f41b-4caf-b520-56316ae4c199",

        "constraints": {}

        "validation": [],

        "count": 64,

        "path": "/api/autoprobe"

    },

    "data": {

        "type": "autoprobe",

        "id": "3",

        "attributes": {

            "name": "<string>",

            "status": <boolean>,

            "description": "<string?",

            "probe_type": "<Enum>",

            "retries": <int>

            "interval": <int>

            "primary_address": "<String>",

            "primary_port": <int>,

            "secondary_address": "<string>",

            "secondary_port": <int>,

            "probe_status": "<Enum>",

            "snmp_security": {

                "snmp_version": "<Enum>",

                "community": "<String>",

                "user_name": "<String>",

                "privacy_mode": "<Enum>",

                "auth_proto": "<Enum>",

                "authentication_pass_phrase": "<String>",

                "priv_proto": "<Enum>",

                "privacy_pass_phrase": "<String>",

                "primary_oid": "<String>",

                "secondary_oid": "<String>"

            }

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET All AutoProbe Status

 

Title

GET All AutoProbe Status

URL

/api/autoprobe_status

Method

GET

Success Response

Code: 200

Content:

{

    "meta": {

        "id": "7de6d2f4-f8f5-4165-bbdb-54d659b29793",

        "path": "/api/autoprobe_status"

    },

    "data": [{

            "type": "autoprobe",

            "id": "1",

            "attributes": {

                "name": "watchdog_ping",

                "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

            }

        },

        {

            "type": "autoprobe",

            "id": "2",

            "attributes": {

                "name": "watchdog_ntp",

                "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

            }

        },

        {

            "type": "autoprobe",

            "id": "3",

            "attributes": {

                "name": "autoprobe_name1",

                "probe_status": "AUTOPROBE_STATUS_FAILED_INIT"

            }

        },

        {

            "type": "autoprobe",

            "id": "4",

            "attributes": {

                "name": "autoprobe_name2",

                "probe_status": "AUTOPROBE_STATUS_FAILED_INIT"

            }

        }

    ]

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

GET One AutoProbe Status

 

Title

GET One AutoProbe Status

URL

/api/autoprobe_status/:id

OR

/api/autoprobe_status/:name

Note: NO HTTP header required to get autoprobe status by ID

Method

GET

URL Params

/api/autoprobe_status/:id

OR

/api/autoprobe_status/:name

Note: No HTTP header required to get by id

http header "by: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[string]

example: 'autoprobe1'

Success Response

Code: 200 
Content: 

{

    "meta": {

        "id": "51b85c59-64ac-4d73-9e9b-7083a9f0b9b0",

        "path": "/api/autoprobe_status/watchdog_ping"

    },

    "data": {

        "type": "autoprobe",

        "id": "1",

        "attributes": {

            "name": "watchdog_ping",

            "probe_status": "AUTOPROBE_STATUS_UNKNOWN"

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Create AutoProbe Settings

 

Title

Create AutoProbe Settings

URL

/api/autoprobe

Method

POST

Data Params

 {

       "data": {

           "type": "autoprobe",

           "attributes": {

//---- For Ping/NTP/Snmpv1/2/3

               "name": "autoprobe_name099",

               "status": true,

               "description": "autoprobe_description",

               "probe_type": "AUTOPROBE_TYPE_SNMP",

               "retries": 3,

               "interval": 10,

               "primary_address": "10.10.10.10",

               "secondary_address": "20.20.20.20",

//---- Only for /NTP/Snmpv1/2/3

"primary_port": 2020,

               "secondary_port": 4040,

//---- Only for Snmpv1/2/3

               "snmp_security": {

                   "snmp_version": "SNMP_PROTOCOL_V3",

                   "community": "autoprobe_community",

                   "user_name": "autoprobe_user_name",

                   "privacy_mode": "SNMPV3_AUTH_AUTH_PRIV",

                "auth_proto" : "SNMPV3_AUTH_PROTO_MD5",

                   "authentication_pass_phrase": "autoprobe_auth_pass_phrase",

                   "priv_proto": "SNMPV3_PRIV_PROTO_AES",

                   "privacy_pass_phrase": "autoprobe_pass_phrase",

                   "primary_oid": "autoprobe_primary_oid",

                   "secondary_oid": "autoprobe_secondary_oid"

               }

           }

       }

   }

Success Response

Code: 200 
Content:

{

    "meta": {

        "id": "ea66350c-d95e-45c4-92fb-d8381e9eeb8c",

        "path": "/api/autoprobe"

    },

    "data": {

        "type": "autoprobe",

        "id": "6",

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Update AutoProbe Settings

 

Title

Update AutoProbe Settings

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

Method

PATCH

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to update by id

http header "By: name" required to update by name

Required:

id=[integer] 
example: id=12

name=[String] - example name=autoprobe1

Data Params

{

       "data": {

           "type": "autoprobe",

           "attributes": {

//---- For Ping/NTP/Snmpv1/2/3

               "name": "autoprobe_name3",

               "status": true,

               "description": "autoprobe_description",

               "probe_type": "AUTOPROBE_TYPE_SNMP",

               "retries": 3,

               "interval": 10,

               "primary_address": "10.10.10.10",

               "secondary_address": "20.20.20.20",

//---- Only for NTP/Snmpv1/2/3

      "primary_port": 2020,

               "secondary_port": 4040,

//---- Only for Snmpv1/2/3

               "snmp_security": {

                   "snmp_version": "SNMP_PROTOCOL_V3",

                   "community": "autoprobe_community",

                   "user_name": "autoprobe_user_name",

                   "privacy_mode": "SNMPV3_AUTH_AUTH_PRIV",

                   "auth_proto": "SNMPV3_AUTH_PROTO_MD5",

                   "authentication_pass_phrase": "autoprobe_auth_pass_phrase",

                   "priv_proto": "SNMPV3_PRIV_PROTO_AES",

                   "privacy_pass_phrase": "autoprobe_pass_phrase",

                   "primary_oid": "autoprobe_primary_oid",

                   "secondary_oid": "autoprobe_secondary_oid"

               }

           }

       }

   }

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>"
   },
   "data":{  
      "type":"autoprobe",
      "id":"<string, id>",
      "attributes":{  
         "response":0
      }
   }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

Delete AutoProbe Settings

 

Title

Delete AutoProbe Settings

URL

/api/autoprobe/:id

OR

/api/autoprobe/:name

Method

DELETE

URL Params

/api/autoprobe/:id

OR

/api/autoprobe/:name

Note: No HTTP header required to delete by id

http header "By: name" required to delete by name

Required:

id=[integer] 

example: id=12

OR

name=[String]

example: name=autoprobe1

Success Response

Code: 200 
Content:

   

  "meta":{ 
      "id":"<request id>"
   },
   "data":{       "type":"autoprobe",
      "id":"<integer>",
      "attributes":{ 
         "response":0
      }
   }
}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

Device Control

The Device Control API enables control of the device in the form of Turn On, Turn Off and Reboot. This applies only to devices that supports these functions.

 

 

Turn On Device

 

Title

Turn On Device

URL

/api/controls_turnon_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_turnon_device",

        "attributes": {

        "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

        "turn_on_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 201 
Content:

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnon_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Turn Off Device

 

Title

Turn Off Device

URL

/api/controls_turnoff_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_turnoff_device",

        "attributes": {

            "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

            "turn_off_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 200

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnoff_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

 

 

Reboot Device

 

Title

Reboot Device

URL

/api/controls_reboot_device/execute

Method

PATCH

Data Params

{

    "data": {

        "type": "controls_reboot_device",

        "attributes": {

            "device_id": "< int device ID >", // OR "device_name": "<sting name of device>

            "turn_off_delay": "< int time in sec >",

            "turn_on_delay": "< int time in sec >"

        }

    }

}

Success Response

Code: 200

{

    "meta": {

        "id": "bbf554c7-38e6-42c5-81f5-3256388dbc67"

    },

    "data": {

        "type": "controls_turnoff_device",

        "id": 0,

        "attributes": {

            "response": 0

        }

    }

}

Version 

"Accept-Version: 1.0.0" – If no version provided, the service return the latest one

Device Properties

The Device Properties API displays properties of the device and all connected peripherals, as well as allowing updates of device attributes. It uses the following enums:

 

device_state:

DEVICE_STATE_NORMAL

DEVICE_STATE_CRITICAL

DEVICE_STATE_WARNING

DEVICE_STATE_INFORMATION

DEVICE_STATE_STATUS

DEVICE_STATE_OFFLINE

 

device_type:

DEVICE_TYPE_UNKNOWN

DEVICE_TYPE_UPS

DEVICE_TYPE_PDU

DEVICE_TYPE_ENVIROSENSE

DEVICE_TYPE_AC

DEVICE_TYPE_KVM

DEVICE_TYPE_ASSETTRACKER

DEVICE_TYPE_ATS

DEVICE_TYPE_SWITCH

 

port_mode:

DEVICE_COMM_UNKNOWN         

DEVICE_COMM_RS232

DEVICE_COMM_HID

DEVICE_COMM_USB

DEVICE_COMM_SIMULATED

 

 

init_state:

DEVICE_INIT_STATE_INACTIVE

DEVICE_INIT_STATE_INITIALIZING

DEVICE_INIT_STATE_INITIALIZED

 

device_battery_synchronization_state:

DEVICE_BATTERY_SYNCHRONIZATION_STATE_NONE

DEVICE_BATTERY_SYNCHRONIZATION_STATE_READING

DEVICE_BATTERY_SYNCHRONIZATION_STATE_WRITING

DEVICE_BATTERY_SYNCHRONIZATION_STATE_VERIFYING

 

 

GET All Devices

 

Title

GET All Devices

URL

/api/devices

Method

GET

Success Response

Code: 200 
Content:
{  
   "meta":{  
      "id":"<request id>",
      "constraints":{  
         "max_items":0,
         "min_items":0,
         "editable_attributes":[  
            "name",
            "location",
            "region",
            "role",
            "keyword",
            "importance",
            "install_date"
         ],
         "required_attributes":[  

         ],
         "delete_allowed":true
      },
      "validation":[  
         {  
            "attribute":"device_id",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"name",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":64,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"manufacturer",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"model",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":80,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"protocol",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":1,
            "max_length":40,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"location",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"region",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":128,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"role",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"keyword",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":32,
            "pattern":"",
            "enum":[  

            ],
            "type":"string"
         },
         {  
            "attribute":"importance",
            "maximum":100,
            "minimum":1,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"install_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"deactivate_date",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"date"
         },
         {  
            "attribute":"secs_on_battery",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"alarm_status",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "DEVICE_STATE_NORMAL",
               "DEVICE_STATE_CRITICAL",
               "DEVICE_STATE_WARNING",
               "DEVICE_STATE_INFORMATION",
               "DEVICE_STATE_STATUS",
               "DEVICE_STATE_OFFLINE"
            ],
            "type":"enum"
         },
         {  
            "attribute":"port_mode",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "COM_UNKNOWN",
               "COM_SERIAL",
               "COM_HID",
               "COM_USB",
               "COM_SIMULATED"
            ],
            "type":"enum"
         },
         {  
            "attribute":"device_type",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  
               "DEVICE_TYPE_UNKNOWN",
               "DEVICE_TYPE_UPS",
               "DEVICE_TYPE_PDU",
               "DEVICE_TYPE_ENVIROSENSE",
               "DEVICE_TYPE_AC",
               "DEVICE_TYPE_KVM",
               "DEVICE_TYPE_ASSETTRACKER",
               "DEVICE_TYPE_ATS",
               "DEVICE_TYPE_SWITCH"
            ],
            "type":"enum"
         },
         {  
            "attribute":"sync_inprogress",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"active",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"num_inputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outputs",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_phases",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlets",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_outlet_groups",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_circuits",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_breakers",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"num_heatsinks",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"integer"
         },
         {  
            "attribute":"energy_wise_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"ramp_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"shed_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_current_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_power_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_voltage_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_mainload_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"controllable_loads_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         },
         {  
            "attribute":"load_groups_supported",
            "maximum":0,
            "minimum":0,
            "multiple_of":0,
            "min_length":0,
            "max_length":0,
            "pattern":"",
            "enum":[  

            ],
            "type":"boolean"
         }
      ]
   },
   "data":[  
      {  
         "type":"devices",
         "id":"<string>",
         "attributes":{  
            "device_id":"<uint32>",
            "name":"<string>",
            "manufacturer":"<string>",
            "model":"<string>",
            "protocol":"<string>",
            "location":"<string>",
            "region":"<string>",
            "role":"<string>",
            "keyword":"<string>",
            "importance":"<uint32>",
            "install_date":"<date, in format of YYYY-MM-DD>",
            "deactivate_date":"<date, in format of YYYY-MM-DD>",
            "secs_on_battery":"<uint32>",
            "device_type":"<enum, Device Type>",
            "sync_inprogess":"<boolean>",
            "alarm_status":"<enum, Device State>",
            "active":"<boolean>",
            "num_inputs":"<uint32>",
            "num_outputs":"<uint32>",
            "num_phases":"<uint32>",
            "num_outlets":"<uint32>",
            "num_outlet_groups":"<uint32>",
            "num_circuits":"<uint32>",
            "num_breakers":"<uint32>",
            "num_heatsinks":"<uint32>",
            "energy_wise_supported":"<boolean>",
            "ramp_supported":"<boolean>",
            "shed_supported":"<boolean>",
            "load_current_supported":"<boolean>",
            "load_power_supported":"<boolean>",
            "load_voltage_supported":"<boolean>",
            "controllable_mainload_supported":"<boolean>",
            "controllable_loads_supported":"<boolean>",
            "load_groups_supported":"<boolean>"
            "init_state": "<ENUM - DeviceInitializeState>",
            "configured_device_id": <init>,
            "configured_asset_tag": "<string>",
            "led_ready": <boolean>,
            "load_receptacle_supported": <boolean>,
            "configured_device_id_minimum": <int>,
            "configured_device_id_maximum": <int>,
            "device_battery_synchronization_state": <ENUM - DeviceBatterySynchronizationState>,
            "device_factory_reset_supported" : <boolean>,
            "ramp_shed_config_in_progress": <boolean>
         
}
      },
      {  
         "type":"devices",
         "id":"<string>",
         "attributes":{  
            "device_id":"<uint32>",
            "name":"<string>",
            "manufacturer":"<string>",
            "model":"<string>",
            "protocol":"<string>",
            "location":"<string>",
            "region":"<string>",
            "role":"<string>",
            "keyword":"<string>",
            "importance":"<uint32>",
            "install_date":"<date, in format of YYYY-MM-DD>",
            "deactivate_date":"<date, in format of YYYY-MM-DD>",
            "secs_on_battery":"<uint32>",
            "device_type":"<enum, Device Type>",
       &n