Control Web Panel

Developers => CWP API => Topic started by: mspgroups2020 on March 26, 2023, 10:26:46 PM

Title: CWP API v1/admindomains added domain but domain unable to access
Post by: mspgroups2020 on March 26, 2023, 10:26:46 PM
I used following code create new domain from CWP API.
> Domain Created and listed
> SSL generated, but when i access domain with https / http NOT FOUND


> When i create new domain manual its working,


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://xxxx:2304/v1/admindomains',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('key' => 'xxxx','action' => 'add','user' => 'prod','type' => 'domain','name' => 'school1.xxxx.com','path' => '/public_html','autossl' => '1'),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
Title: Re: CWP API v1/admindomains added domain but domain unable to access
Post by: overseer on April 08, 2023, 03:21:04 AM
Are you creating DNS at the same time? Does the domain resolve properly?
Title: Re: CWP API v1/admindomains added domain but domain unable to access
Post by: josemnunez on April 08, 2023, 01:48:59 PM
Hi

'autossl' => 0