Child pages
  • WHM API 1 Functions - install_spf_records

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt
This function installs a Sender Policy Framework (SPF) record for a domain on the DNS server.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledSendMailRole78
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagetext
https://hostname.example.com:2087/cpsess##########/json-api/install_spf_records?api.version=1&domain=example.com&domain=anotherexample.com&record="v%3dspf1%20ip4:10.0.0.1%20%2Ba%20%2Bmx%20%2Bip4:10.0.0.2%20%2Bip4:10.0.0.3%20-all"&record="v%3dspf1%20ip4:10.0.0.1%20%2Ba%20%2Bmx%20%2Bip4:10.0.0.2%20%2Bip4:10.0.0.3%20-all"



Expand
titleCommand Line


Code Block
languagebash
whmapi1 install_spf_records domain=example.com domain=anotherexample.com record="v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all" record="v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all"

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagebash
linenumberstrue
{
   "data": {
      "payload": [
        {
            "domain": "example.com",
            "msg": "[ADD:TXT@example.com.:v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all]",
            "status": 1
        },
		{
			"domain": "anotherexample.com",
			"msg": "[no changes needed]",
			"status": "1"
		}
    ],
    "metadata": {
        "command": "install_spf_record",
	    "reason": "OK",
	    "status": 1,
		"version": 1
		}
	}
}


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain for which to install an SPF record on the DNS server.

Note
titleNote:

To install multiple SPF 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
recordstring

Required

An SPF record.

Note
titleNote:

You must provide this parameter for every domain parameter.


A valid SPF record.


v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all

Returns

ReturnTypeDescriptionPossible valuesExample
payloadarray of hashes

An array that contains information about the domain's SPF record installation to the DNS server.

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

                

domain

string

The SPF record's associated domain on the DNS server.

This function returns this value in the payload array.

A valid domain.

example.com

msg

string

The SPF record's installation status to the DNS server.

This function returns this value in the payload array.

A valid string.



Expand
titleClick to view...

[ADD:TXT@example.com.:v=spf1 ip4:10.0.0.1 %2Ba %2Bmx %2Bip4:10.0.0.2 %2Bip4:10.0.0.3 -all]


status

Boolean

Whether the system installed the SPF record to the DNS server.

This function returns this value in the payload array.

  • 1 — The system installed the SPF record on the DNS server.
  • 0 — The system cannot install the SPF record on the DNS server.
1