New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

I need help for api , delete domain

Started by taqnawi, February 05, 2024, 10:56:49 AM

Previous topic - Next topic

taqnawi

 This code not working for me, plz give code thanks
       
       $domain = "sub.example.com";
         $data = array("key" => "thoken",'action' => 'delete','user' => 'admin','type' => 'subdomain','name' => $domain,'path' => '/'.$domain);
                  $url = "https://ip:2304/v1/admindomains";
                  $ch = curl_init();
                  curl_setopt($ch, CURLOPT_URL, $url);
                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
                  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
                  curl_setopt ($ch, CURLOPT_POSTFIELDS, http_build_query($data));
                  curl_setopt ($ch, CURLOPT_POST, 1);
                  $response = curl_exec($ch);
                  curl_close($ch);


josemnunez

Please validate if you have the ports open for the use of the api