Description

This function retrieves the default archiving configurations.

Examples 




https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=get_archiving_default_configuration&domain="example.com"



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get the default archiving config for example.com.
$get_default_archive_config = $cpanel->api2(
    'Email', 'get_archiving_default_configuration', 
    array(
        'domain'       => 'example.com',
    ) 
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Get the default archiving config for example.com.
my $get_default_archive_config = $cpliveapi->api2(
    'Email', 'get_archiving_default_configuration',
    { 
        'domain'       => 'example.com',
    }
);




cpapi2 --user=username Email get_archiving_default_configuration domain=example.com



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "get_archiving_default_configuration",
    "data": [
      {
        "direction": "outgoing",
        "retention_period": "7",
        "enabled": 1
      },
      {
        "direction": "mailman",
        "retention_period": "14",
        "enabled": 1
      },
      {
        "direction": "incoming",
        "retention_period": "21",
        "enabled": 1
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Email"
  }
}



Parameters

Make certain that you use the correct parameters when you call this function. The function does not return errors if you pass invalid parameters.


ParameterTypeDescriptionPossible valuesExample
domainstring

The domain to query.

If you do not use this parameter, the function lists the account's default configuration.

A valid domain on the cPanel account.

example.com

Returns

ReturnTypeDescriptionPossible valuesExample
directionstringThe message type.
  • outgoing
  • mailman
  • incoming
outgoing
retention_periodintegerThe message retention period.
  • A positive integer that represents the number of days to archive messages.
  • 0 or null — Archiving is disabled.
14
enabledBooleanWhether archiving is enabled.
  • 1 — Enabled.
  • 0 — Disabled.
1
reasonstring

A reason for failure.

This function only returns a reason value if it failed. 


A string that describes the error.

This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1