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 - enable_dkim - Developer Documentation - cPanel Documentation
Child pages
  • WHM API 1 Functions - enable_dkim
Skip to end of metadata
Go to start of metadata

Description

This function enables Domain Keys Identified Mail (DKIM) records on the DNS server for one or more domains.

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/enable_dkim?api.version=1&domain=example.com&domain=anotherexample.com
 Command Line
whmapi1 enable_dkim 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": "Installed Keys",
            "status": 1
        },
		{
			"domain": "anotherexample.com",
			"msg": "[no changes needed]",
			"status": 1
		}
    ],
  "metadata": {
      "command": "enable_dkim",
	  "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 enable DKIM records on the DNS server.

Note:

To enable multiple domain DKIM records, 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 enabled state of a domain's DKIM records on the DNS server.

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

                

domain

string

The domain for which the system enabled the DKIM record.

This function returns this value in the payload array.

A valid domain.

example.com

msg

string

The domain's DKIM record status message.

This function returns this value in the payload array.

A valid string.Installed Keys

status

Boolean

Whether the system enabled the domain's DKIM record on the DNS server.

This function returns this value in the payload array.

  • 1 — The system enabled the domain's DKIM record.
  • 0 — The system did not enable the domain's DKIM record.
1