Description

This function returns an account's raw SPF record.

Examples 




https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=username&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=SPFUI&cpanel_jsonapi_func=get_raw_record&user=username



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Return raw SPF record for example.com.
$get_raw_record = $cpanel->api2(
    'SPFUI', 'get_raw_record', 
		array(
		'user'			=> 'username'
	 ) 
);

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Return raw SPF record for example.com.
my $get_raw_record = $cpliveapi->api2(
    'SPFUI', 'get_raw_record',
		{
		'user'			=> 'username'
		}
 );




cpapi2 --user=username SPFUI get_raw_record user=username



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "get_raw_record",
    "data": [
      {
        "record": "v=spf1 +a +mx +ip4:10.1.100.35 +ip6:2001:db8:1a34:56cf::/64" 
      }
    ],
    "event": {
      "result": 1
    },
    "module": "SPFUI"
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

The account's username.

If you do not specify a value, this parameter defaults to the currently authenticated username.

The cPanel account username.
username

 

Returns

ReturnTypeDescriptionPossible valuesExample
recordstringThe account's raw SPF record.

An SPF record.

In cPanel & WHM version 54 and later, this value may contain IPv6 addresses.



v=spf1 +a +mx +ip4:10.1.100.35 +ip6:2001:db8:1a34:56cf::/64


reasonstring

A reason for failure.

This function only returns a reason value if there was an error. 


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