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; either a Web Security appliance, Email Security appliance, or a Security Management appliance.

This chapter contains the following sections:

Querying for the System Time

Sample Request

GET /sma/api/v2.0/config/system_time?device_type=sma 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: sma.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 /sma/api/v2.0/config/appliances?device_type=sma 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: sma.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"
                }
            }
        ]
    }
}

Querying for the Details of Centralized Services

Sample Request

GET /sma/api/v2.0/config/centralized_services?device_type=sma 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46Q2lzY28xMjMk
Accept: */*
Host: sma.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:13:50 GMT
Content-type: application/json
Content-Length: 169
Connection: close
{
    "data": {
        "centralized_quarantines": {
            "pvo_quarantine": "Enabled",
            "spam_quarantine": "Enabled"
        },
        "centralized_reporting": "Enabled",
        "centralized_tracking": "Enabled"
    }
}

Querying for Reporting Groups' Information

You can query for information about Reporting Groups, that include one or more Email Security appliances.

Sample Request

GET /sma/api/v2.0/config/reporting_groups?device_type=sma 
HTTP/1.1
cache-control: no-cache
Authorization: Basic YWRtaW46SXJvbnBvcnQxMjMk
Accept: */*
Host: sma.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 05:41:47 GMT
Content-type: application/json
Content-Length: 397
Connection: close
{
    "data": {
        "reporting_groups": [
            {
                "2_esa_grp": {
                    "appliances": [
                        "123A45B6C678-1CDEFG2",
                        "123A45B6C678-1CDEFG3"
                    ]
                }
            },
            {
                "Emtpy_Group": {
                    "appliances": []
                }
            },
            {
                "du!@#$%^&*()_+{}=_+{}][:\"';<>?/.,": {
                    "appliances": [
                        "123A45B6C678-1CDEFG4",
                        "123A45B6C678-1CDEFG5"
                    ]
                }
            },
            {
                "Hosted_Group": {
                    "appliances": [
                        "123A45B6C678-1CDEFG6",
                        "123A45B6C678-1CDEFG7"
                    ]
                }
            },
            {
                "1_esa_grp": {
                    "appliances": [
                        "123A45B6C678-1CDEFG8"
                    ]
                }
            }
        ]
    }
}

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 /sma/api/v2.0/login/privileges
HTTP/1.1
cache-control: no-cache
Postman-Token: a7eca7b8-0656-43db-b692-812396a86976
Authorization: Basic YWRtaW46SXJvbnBvcnQxMjMk
Accept: */*
Host: sma.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",
        "sma_config_users",
        "e_config_euq_authentication_method",
        "e_config_euq_url_details"
    ]
}