General Purpose APIs

General purpose configuration queries will have the config resource name as part of the query string. You can only retrieve configuration information (GET), and cannot perform any changes (POST, DELETE) in this release. You can specify the device type to indicate the device from which you need the configuration from the appliance .

This chapter contains the following sections:

Querying for the System Time

Sample Request

GET /esa/api/v2.0/config/system_time? 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: esa.example.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive

Sample Response

HTTP/1.0 200 OK
Server: API/2.0
Date: Thu, 12 Apr 2018 18:06:32 GMT
Content-type: application/json
Content-Length: 121
Connection: close
{
    "data": {
        "continent": [
            "Asia",
            "India",
            "Kolkata"
        ],
        "time": "Thu Apr 12 23:38:05 2018 IST",
        "timezone": "Asia/Kolkata"
    }
}

Querying for Managed Email Security Appliances' Information

Sample Request

GET /esa/api/v2.0/config/appliances? 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: esa.example.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive

Sample Response

HTTP/1.0 200 OK
Server: API/2.0
Date: Thu, 12 Apr 2018 18:09:07 GMT
Content-type: application/json
Content-Length: 341
Connection: close
{
    "data": {
        "appliances": [
            {
                "123A45B6C678-1CDEFG2": {
                    "host_name": "esa11.1",
                    "ip_address": "10.76.69.29",
                    "product_type": "ESA"
                }
            },
            {
                "123A45B6C678-1CDEFG3": {
                    "host_name": "esa11.0",
                    "ip_address": "10.76.68.224",
                    "product_type": "ESA"
                }
            },
            {
                "123A45B6C678-1CDEFG3": {
                    "host_name": "esa10.0.2",
                    "ip_address": "10.76.71.63",
                    "product_type": "ESA"
                }
            }
        ]
    }
}

Retrieving APIs Accessible to a User Role

You can retrieve a list of APIs that are available for a currently logged in user.

Synopsis

GET /api/v2.0/login/privileges

Request Headers

Host, Accept, Authorization

Response Headers

Content-Type, Content-Length, Connection

Sample Request

GET /esa/api/v2.0/login/privileges
HTTP/1.1
cache-control: no-cache
Postman-Token: a7eca7b8-0656-43db-b692-812396a86976
Authorization: Basic YWRtaW46SXJvbnBvcnQxMjMk
Accept: */*
Host: esa.example.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive

Sample Response

HTTP/1.0 200 OK
Server: API/2.0
Date: Thu, 12 Apr 2018 14:17:44 GMT
Content-type: application/json
Content-Length: 4392
Connection: close
{
    "data": [
        "e_message_tracking_messages",
        "e_message_tracking_detail",
        "e_message_tracking_availability",
        "e_message_tracking_verdict",
        "e_message_tracking_dlp_details",
        "e_message_tracking_amp_details",
...
...
        "e_config_macro_file_types",
        "e_config_geo_countries",
        "e_config_tracking_query_timeout",
        "e_config_spam_quarantine_appearance_details",
        "esa_config_users",
        "e_config_euq_authentication_method",
        "e_config_euq_url_details"
    ]
}

Health API

You can retrieve information about system health using the health API.

Synopsis

GET /api/v2.0/health/

Request Headers

Host, Authorization

Response Headers

Content-Type, Content-Length, Connection

Sample Request

GET /esa/api/v2.0/health
HTTP/1.1
cache-control: no-cache
Postman-Token: a7eca7b8-0656-43db-b692-812396a86976
Authorization: BasicYWRtaW46SXJvbnBvcnQxMjMk 
Accept: */*
Host: esa.example.com:6080
accept-encoding: gzip, deflate
Connection: keep-alive

Sample Response

HTTP/1.0 200 OK
Server: API/2.0
Date: Thu, 12 Sept 2019 14:17:44 GMT
Content-type: application/json
Content-Length: 260
Connection: close
{
"data": {
"percentage_ram_utilization": 1,
"percentage_diskio": 0,
"resource_conservation": 0,
"messages_in_workqueue": 0,
"messages_in_pvo_quarantines": 0,
"percentage_swap_utilization": 0,
"percentage_queue_utilization": 0,
"percentage_cpu_load": 18
}
}