Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function checks whether the account's domains can pass Domain Control Validation (DCV) via an HTTP call.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/DCV/check_domains_via_http?domain-1=example1.com&domain-2=example2.com&domain-3=example3.com

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server.
$poll = $cpanel->uapi(
    'DCV', 'check_domains_via_http',
    array(
        'domain-1' => 'example1.com',
        'domain-2' => 'example2.com',
        'domain-3' => 'example3.com'
  )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
#  Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server.
my $poll = $cpliveapi->uapi(
    'DCV', 'check_domains_via_http',
    {
        'domain-1'  => 'example1.com',
        'domain-2'  => 'example2.com',
        'domain-3'  => 'example3.com'
  }
);

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- Check the example1.com, example2.com, and example3.com domains to see if they resolve to the local server. -->
[% execute('DCV', 'check_domains_via_http', { 'domain-1' => 'example1.com','domain-2'=>'example2.com','domain-3'=>'example3.com' } ) %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username DCV check_domains_via_http domain-1=example1.com domain-2=example2.com domain-3=example3.com

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{  
   "data":[  
      {  
         "failure_reason":undef,
         "redirects_count":0
      },
      {  
         "failure_reason":"This is why I don't like your domain ...",
         "redirects_count":1
      },
      {  
         "failure_reason":undef,
         "redirects_count":2
      }
   ],
   "messages":null,
   "metadata":{  
      "transformed":1
   },
   "status":1,
   "errors":null
}

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domains to check.

Note:

To check multiple domains, duplicate or increment the parameter name. For example, to check three domains, use the domain parameter multiple times or use the domain-1, domain-2, and domain-3 parameters.

A valid domain name.example1.com

 

Returns

ReturnTypeDescriptionPossible valuesExample
dataarray of hashes

This array of hashes contains results from each domain parameter's DCV check.

Note:

The function returns the results from the domains in the same order in which you called them.

This array of hashes contains the failure_reason and redirects_count returns.


failure_reason

string

The reason that the DCV check failed.

The function returns this value in the data array of hashes.

  • undef — The domain passes the DCV check.
  • A valid string that contains the reason why the DCV check failed.
This is why I don’t like your domain …

redirects_count

integer

The number of redirects that the DCV required to reach the domain.

The function returns this value in the data array of hashes.

A valid integer.2