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

Description

This function confirms the validity of a Domain Keys Identified Mail (DKIM) key for one or more domains.

Notes;

  • If an existing DKIM key does not meet the server's security requirements, the system replaces the existing DKIM key.
  • If no DKIM key exists, the system creates a new key for the domain.


Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/ensure_dkim_keys_exist?api.version=1&domain=example.com&domain=anotherexample.com
 Command Line
whmapi1 ensure_dkim_keys_exist domain=example.com domain=anotherexample.com


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": [
        {
            "domain": "example.com",
            "msg": "created new key",
            "status": 1
        },
		{
			"domain": "anotherexample.com",
			"msg": "key is acceptable",
			"status": 1
		}
    ],
  "metadata": {
      "command": "ensure_dkim_keys_exist",
	  "reason": "OK",
	  "result": 1,
	  "version": 1
	  }
	}
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain for which to confirm a valid DKIM key exists.

Note:

To check the DKIM key validity for multiple domain, duplicate the parameter name. For example, use the domain=example.com, domain=example2.com, and domain=example3.com parameters.

A valid domain.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
payloadarray of hashes

An array that contains information about the domain's DKIM key validity.

Each hash contains the domain, msg, and status values.

                

domain

string

The domain for which the system confirmed that a valid DKIM key exists.

This function returns this value in the payload array.

A valid domain.

example.com

msg

string

The domain's DKIM key status message.

This function returns this value in the payload array.

A valid string.created new key

status

Boolean

Whether the system verified that the domain's DKIM key exists.

This function returns this value in the payload array.

  • 0 — The system did not verify the existence of the domain's DKIM key.
  • 1 — The system verified the existence of the domain's DKIM key.
1