Attribute-based statistics API

Prev Next

Users can view the statistics of emails via the Dashboard and Reports tabs on the ETP Portal. The Statistics API presents similar data to the users.

Required header:

x-fireeye-api-key: <key>—Specifies your personal API key.

Entitlement:

etp.dashboard.read entitlement

Options

  • traffic_type—(inbound or outbound) Traffic type defaults to inbound. To handle outbound traffic, set the traffic_type parameter to outbound.

Timezone

The timestamp in request and in response is in UTC.

Parameters:

The table below provides the list of attributes:

Parameter

Data type

Default value

Description

stats_name

string

email_traffic

Specifies the type of statistics to be retrieved.

Allowed names are "delivery_status", "detections", "email_traffic")

domain

string

Nil

Domain name. When it is not specified, all the domains are included.

period

dict

Last 24 hours

Range: fromDateTime, toDateTime.

Maximum range can be up to 30 days from the current day.

For example: "period": { "range": { "fromDateTime": "2021-03-01T10:20:00", "toDateTime": "2021-03-20T10:20:00" } }

fromDateTime

Time stamp in ISO format

Time stamp closest to 24 hours ago, multiple of 30 minutes

Start of the time range in UTC time. If the time specified is not a multiple of 30 minutes, it is rounded up to the nearest multiple of 30 minutes. The value for fromDateTime can be up to 30 days ago.

toDateTime

Time stamp in ISO format

Time stamp closest to current time, multiple of 30 minutes

End of time range in UTC time. If the time input specified is not a multiple of 30 minutes, it is rounded down to the nearest multiple of 30 minutes.

Stats names and sections:

The sections included in the response are based on the mode of domains of the user or the domain specified in the API request.

The table provides the stats name and the sections:

Stats name

Sections

delivery_status

  • emails_delivered

  • temporary_failures

  • permanent_failures

detections

  • malicious

  • spam

  • virus

email_traffic

  • emails_accepted

  • emails_received

  • emails_delivered

  • emails_scanned

  • emails_remediated

Example of inbound requests

Values for ID and other fields are for illustration only.

Email traffic request:

{
    "attributes": {
        "stats_name": "email_traffic",
        "domain": "musubi2.etp-testdomain5.com",
        "period": {
            "range": {
                "fromDateTime": "2021-03-01T10:20:00",
                "toDateTime": "2021-03-20T10:20:00"
            }
        }
    }
}

Delivery status request:

 {
    "attributes": {
        "stats_name": "delivery_status",
        "domain": "musubi2.etp-testdomain5.com",
        "period": {
            "range": {
                "fromDateTime": "2021-03-01T10:20:00",
                "toDateTime": "2021-03-20T10:20:00"
            }
        }
    }
}

Detections request:

{
    "attributes": {
        "stats_name": "detections",
        "domain": "musubi2.etp-testdomain5.com",
        "period": {
            "range": {
                "fromDateTime": "2021-03-01T10:20:00",
                "toDateTime": "2021-03-20T10:20:00"
            }
        }
    }
}

Inbound responses

Email traffic response:

{
  "data": {
    "email_traffic": {
      "emails_accepted": [
        {
          "key": "total",
          "value": 10672
        }
      ],
      "emails_received": [
        {
          "key": "total",
          "value": 10677
        }
      ],
      "emails_delivered": [
        {
          "key": "total",
          "value": 9992
        }
      ],
      "emails_scanned": [
        {
          "key": "total",
          "value": 20
        }
      ],
      "emails_remediated": [
        {
          "key": "total",
          "value": 11
        }
      ]
    }
  },
  "meta": {
    "fromDateTime": "2021-03-01T10:30:00",
    "toDateTime": "2021-03-20T10:00:00",
    "copyright": "Copyright 2021 FireEye Inc"
  }
}

Delivery status response:

{
  "data": {
    "delivery_status": {
      "emails_delivered": [
        {
          "key": "total",
          "value": 9992
        }
      ],
      "temporary_failures": [
        {
          "key": "total",
          "value": 210
        }
      ],
      "permanent_failures": [
        {
          "key": "total",
          "value": 4
        }
      ]
    }
  },
  "meta": {
    "fromDateTime": "2021-03-01T10:30:00",
    "toDateTime": "2021-03-20T10:00:00",
    "copyright": "Copyright 2021 FireEye Inc"
  }
}

Detections response:

{
  "data": {
    "detections": {
      "malicious": [
        {
          "key": "total",
          "value": 14
        }
      ],
      "spam": [
        {
          "key": "total",
          "value": 95
        }
      ],
      "virus": [
        {
          "key": "total",
          "value": 33
        }
      ]
    }
  },
  "meta": {
    "fromDateTime": "2021-03-01T10:30:00",
    "toDateTime": "2021-03-20T10:00:00",
    "copyright": "Copyright 2021 FireEye Inc"
  }
}

Example of outbound request

Values for ID and other fields are for illustration only

Email traffic request:

{
    "attributes": {
        "stats_name": "email_traffic",
        "domain": "outboundmusubi2.etp-testdomain5.com",
        "period": {
            "range": {
                "fromDateTime": "2021-03-01T10:20:00",
                "toDateTime": "2021-03-20T10:20:00"
            }
        }
    },
    "traffic_type": "outbound"
}

Outbound response

Email traffic response:

{
  "data": {
    "email_traffic": {
      "emails_accepted": [
        {
          "key": "total",
          "value": 10672
        }
      ],
      "emails_received": [
        {
          "key": "total",
          "value": 10677
        }
      ],
      "emails_delivered": [
        {
          "key": "total",
          "value": 9992
        }
      ]
    }
  },
  "meta": {
    "fromDateTime": "2021-03-01T10:30:00",
    "toDateTime": "2021-03-20T10:00:00",
    "copyright": "Copyright 2021 FireEye Inc"
  }
}

cURL code sample: email traffic stats for outbound

curl -XPOST https://etp.us.fireeye.com/api/v1/stats -H "Content-Type: application/json" -H "x-fireeye-api-key: xxxxxxxxxxxxxxx " -d
'{
    "attributes": {
        "stats_name": "email_traffic",
        "domain": " outboundmusubi2.etp-testdomain5.com",
        "period": {
            "range": {
                "fromDateTime": "2021-03-19T10:00:00",
                "toDateTime": "2021-03-20T10:00:00"
            }
        }
    },
    "traffic_type": "outbound"
}'

This cURL sample includes the following options:

  • -X POST—This option changes the HTTP method to POST.

  • --header "Content-Type: application/json"—This header specifies that the server's response body is expected to be in JSON format.

  • --header 'x-fireeye-api-key: xxxxxxxxxxxxxxx'—This header specifies your personal API key.

  • https://etp.us.fireeye.com/api/v1/stats — The stats API request URL. Replace etp.us.fireeye.com with the address of your Email Security — Cloud instance.

  • -d '{<data>}'—The request parameters.