Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
WHM API 1 Functions - get_unique_recipient_count_per_sender_for_user - Developer Documentation - cPanel Documentation
Child pages
  • WHM API 1 Functions - get_unique_recipient_count_per_sender_for_user
Skip to end of metadata
Go to start of metadata

Description

This function gets the number of unique recipients that a system user sent mail to within a period of time. It groups this data by each of the user's email accounts.

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_recipient_count_per_sender_for_user?api.version=1&user=username&start_time=1550872800&end_time=1550923200
 Command Line
whmapi1 get_unique_recipient_count_per_sender_for_user start_time=1550872800 end_time=1550923200


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" : [
         {
            "sender" : "username@example.com",
            "unique_recipient_count" : 51
         },
         {
            "unique_recipient_count" : 51,
            "sender" : "username@example2.com"
         }
      ]
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The system user's username.

A valid system username.

username

start_timeinteger

Required

A start time to query.

A valid timestamp, in Unix Epoch format.1550872800
end_timeinteger

Required

An end time to query.

A valid timestamp, in Unix Epoch format.1550923200

Returns

ReturnTypeDescriptionPossible valuesExample
payloadarray of hashes

An array that contains a count of the number of unique recipients a system user sent mail to.

Each hash contains the sender and unique_recipient_count returns.


sender

string

The user's email address.

This function returns this value in the payload array.

A valid user email address.username@example.com

unique_recipient_count

integer

The number of unique recipients that the email account sent mail to.

This function returns this value in the payload array.

A positive integer.51