Author Topic: Error when using api to create email account  (Read 17 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Error when using api to create email account
« on: Today at 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;
  ?>