Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function retrieves email tracking statistics.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/emailtrack_stats?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/emailtrack_stats?api.version=1
 Command Line
whmapi1 emailtrack_stats

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
  "data": {
    "records": [
      {
        "TOTALSIZE": "26357",
        "SUCCESSCOUNT": "17",
        "SENDCOUNT": "18",
        "DEFERCOUNT": "0",
        "FAILCOUNT": "1",
        "INPROGRESSCOUNT": "0",
        "DEFERFAILCOUNT": "1"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "overflowed": 0,
    "result": 1,
    "command": "emailtrack_stats"
  }
}
 Output (XML)
<result>
    <data>
        <records>
            <TOTALSIZE>26357</TOTALSIZE>
            <SUCCESSCOUNT>17</SUCCESSCOUNT>
            <SENDCOUNT>18</SENDCOUNT>
            <DEFERCOUNT>0</DEFERCOUNT>
            <FAILCOUNT>1</FAILCOUNT>
            <INPROGRESSCOUNT>0</INPROGRESSCOUNT>
            <DEFERFAILCOUNT>1</DEFERFAILCOUNT>
        </records>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <overflowed>0</overflowed>
        <result>1</result>
        <command>emailtrack_stats</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
recordsstring

The email address to query.

If you do not specify a value, the function retrieves statistics for all of the server's addresses.

A valid email address.

user@example.com
starttimeinteger

The start time of the search window.

This parameter defaults to 0.

A valid date in Unix time format.1371552781
endtimeinteger

The end time of the search window.

This parameter defaults to the current time.

A valid date in Unix time format.1471552781
deliverytypestring

The type of delivery to query.

If you do not specify a value, this function returns all types.

  • remote
  • remote-or-faildefer
  • local
remote
nosuccessBoolean

Whether to hide the SUCCESSCOUNT parameter.

This parameter defaults to 0.

  • 1 — Hide.
  • 0 — Do not hide.
0
nosizeBoolean

Whether to hide the TOTALSIZE parameter.

This parameter defaults to 0.

  • 1 — Hide.
  • 0 — Do not hide.
0


Returns

ReturnTypeDescriptionPossible valuesExample
recordsarray of hashesAn array of hashes of the message information.Each hash includes the DEFERMAILCOUNT, TOTALSIZE, SUCCESSCOUNT, SENDCOUNT, DEFERCOUNT, FAILCOUNT, and INPROGRESSCOUNT returns. 

DEFERMAILCOUNT

integer

The number of messages that the system deferred and failed to deliver.

The function returns this value in the records hash.

A positive integer.0

TOTALSIZE

integer

The total size of messages that the server sent.

The function returns this value in the records hash.

A positive integer that measures the total size in bytes.27444

SUCCESSCOUNT

integer

The number of successful deliveries.

The function returns this value in the records hash.

Note:

If a message has three recipients, it can have a total of three successful deliveries.

A positive integer.14

SENDCOUNT

integer

The number of sent messages.

The function returns this value in the records hash.

A positive integer.14

DEFERCOUNT

integer

The number of deferral events.

The function returns this value in the records hash.

A positive integer.0

FAILCOUNT

integer

The number of delivery failures.

The function returns this value in the records hash.

Note:

If a message has three recipients, it can have a total of three failed deliveries.

A positive integer.0

INPROGRESSCOUNT

integer

The number of messages currently in progress.

The function returns this value in the records hash.

A positive integer.1