Child pages
  • WHM API 1 Functions - get_unique_sender_recipient_count_per_user
Skip to end of metadata
Go to start of metadata

Description

This function gets a count of the email addresses that each system account sent mail to within a specific period of time. It groups the data by each system user for all the system's users.

Important:

When you disable the MailSend role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_unique_sender_recipient_count_per_user?start_time=1550702383&end_time=1551192100
 Command Line
whmapi1 get_unique_sender_recipient_count_per_user start_time=1550702383 end_time=1551192100


Notes:

  • Unless otherwise noted, 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.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data" : {
      "payload" : [
         {
            "user" : "username",
            "unique_sender_recipient_count" : 120
         },
         {
            "user" : "username2",
            "unique_sender_recipient_count" : 12
         },
         {
            "user" : "username3",
            "unique_sender_recipient_count" : 50
         }
      ]
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
start_timeinteger

Required

A start time to query.

A valid timestamp, in Unix Epoch format.

1550702383

end_timeinteger

Required

An end time to query.

A valid timestamp, in Unix Epoch format.1551192100

Returns

ReturnTypeDescriptionPossible valuesExample
payloadarray of hashes

An array that contains a count for all system users' unique email recipients.

Each hash contains the user and unique_sender_recipient_count returns.


user

string

A system user's username.

This function returns this value in the payload array.

A valid system username.username

unique_sender_recipient_count

integer

A count of the unique sender-recipient pairs for mail sent during a period of time.

This function returns this value in the payload array.

A positive integer.120