Control Web Panel

WebPanel => Information => Topic started by: masrnet on September 13, 2025, 10:31:45 AM

Title: Error when using api to create email account
Post by: masrnet on September 13, 2025, 10:31:45 AM
Error when using api to create email account
  I get response Error :
  {"status":"Error","result":"invalid action"}

code :
<?php
$url = "https://my_server_ip:2304/v1/email";
$api = "lgyfdsgfdsgkuh6Z4Eicoxedwfcc34153vtK0QUQCgbStG9T2ufUjw4";
    $data = [
        'key' => $api,
      'user' => 'mooga',
        'action' => 'add',
        'domain' => "mooga.com",
        'email' => "info",
        'pass' => "123456",
        'quotamail' => "500",
      'debug' => 1
    ];
$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_VERIFYHOST, FALSE);
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);
 echo $response;
  ?>