Announcement

Collapse
No announcement yet.

API order domain HELP PLEASE

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • API order domain HELP PLEASE

    Hi, Thank you for reading this.
    I have been working on this base part of the code for hourly.
    I keep getting this error code "Invalid domains data provided" but I have read the part of the api doc and still cant get it to work.
    Thank you
    I am running PHP 7.3
    The code is
    <?php
    function command_domain($username,$ip,$country,$domain_name ,$domain_tld) {
    if (!$curl = curl_init('https://api.duoservers.com/' . '/'))
    return 'error1';


    $parameters['auth_username'] = '******X';
    $parameters['auth_password'] = '******X';
    $parameters["section"] = "order";
    $parameters["command"] = "order_domains";
    $parameters['return_type'] = 'serialization';
    $parameters["username"] = $username;
    $parameters["ip"] = $ip;
    $parameters["price_type"] = "wholesale"; //wholesale
    $parameters["payment_method"] = "Wallet"; //Wallet Trial
    $parameters["currency"] = "USD";
    $parameters["country"] = $country;
    $parameters["return_url"] = "https://thankyou.duoservers.com/";
    $parameters["cancel_url"] = "https://thankyou.duoservers.com/";
    $parameters["orderrder_domains:domains"] = array("type" => "register","sld" => $domain_name,"tld" => $domain_tld,"period" => 1,"custom_nameservers" => 0, "orderrder_domains:domains:contacts" => array("registrantfirstname" => "firstname",
    "registrantlastname" => "Domains",
    "registrantorganizationname" => "Chima Enterprise Inc",
    "registrantaddress1" => "341 Main St",
    "registrantpostalcode" => "06516",
    "registrantcity" => "West Haven",
    "registrantstateprovince" => "Connecticut",
    "registrantcountry" => "USA",
    "registrantemailaddress" => "domains@chimaenterprise.com",
    "registrantphone" => "7142027866"));


    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($parameters));
    $response = curl_exec($curl);
    echo $curl;
    if (!$response = curl_exec($curl))
    return 'error2';

    $result = unserialize($response);
    if (!is_array($result))
    return 'error3';

    return $result[1];
    }

    if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    $ip = $_SERVER['HTTP_CLIENT_IP'];
    } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    } else {
    $ip = $_SERVER['REMOTE_ADDR'];
    }
    $info = command_domain('***XX', $ip, 'USA','******XX','com');

    ?>

  • #2
    Hi,

    What TLD are you trying to order? I think if you order a .com for example you also need to provide more fields. For example, if the client wants id_protect, or if whois is to be redacted to comply with EU GDPR etc

    Also, if the system determines that the customer IP is in Europe, you have to submit is_business

    For US based clients I think you have to submit category and purpose information.

    I would try submitting as many of the keys as possible (even if the manual says they are optional)
    Last edited by clivejo; 4 days ago.

    Comment


    • #3
      Thank you for the help. I have try to add as many thing I can. but it is not working

      $contacts = array("registrantfirstname" => "Chima",
      "registrantlastname" => "Domains",
      "registrantorganizationname" => "Chima Enterprise Inc.",
      "registrantaddress1" => "341 Main St",
      "registrantpostalcode" => "06516",
      "registrantcity" => "West Haven",
      "registrantstateprovince" => "ct",
      "registrantcountry" => "us",
      "registrantemailaddress" => "******X@chimaenterprise.com",
      "registrantphone" => "7142027866",
      "techfirstname" => "Chima",
      "techlastname" => "Domains",
      "techaddress1" => "341 Main St",
      "techpostalcode" => "06516",
      "techcity" => "West Haven",
      "techstateprovince" => "ct",
      "techcountry" => "us",
      "techemailaddress" => "******X@chimaenterprise.com",
      "techphone" => "7142027866",
      "adminfirstname" => "Chima",
      "adminlastname" => "Domains",
      "adminorganizationname" => "Chima Enterprise Inc.",
      "adminaddress1" => "341 Main St",
      "adminpostalcode" => "06516",
      "admincity" => "West Haven",
      "adminstateprovince" => "ct",
      "admincountry" => "us",
      "adminemailaddress" => "******X@chimaenterprise.com",
      "adminphone" => "7142027866",
      "billingfirstname" => "Chima",
      "billinglastname" => "Domains",
      "billingorganizationname" => "Chima Enterprise Inc.",
      "billingaddress1" => "341 Main St",
      "billingpostalcode" => "06516",
      "billingcity" => "West Haven",
      "billingstateprovince" => "ct",
      "billingcountry" => "us",
      "billingemailaddress" => "******X@chimaenterprise.com",
      "billingphone" => "7142027866");


      $domain_t = $domain_name.'.'.$domain_tld;
      $parameters['auth_username'] = '******X';
      $parameters['auth_password'] = '******X*!';
      $parameters["section"] = "order";
      $parameters["command"] = "order_domains";
      $parameters['return_type'] = 'serialization';
      $parameters["username"] = $username;
      $parameters["ip"] = $ip;
      $parameters["price_type"] = "wholesale"; //wholesale
      $parameters["payment_method"] = "Wallet"; //Wallet Trial
      $parameters["currency"] = "USD";
      $parameters["country"] = $country;
      $parameters["is_business"] = 0;
      $parameters["vat_number"] = "0";
      $parameters["return_url"] = "https://thankyou.duoservers.com/";
      $parameters["cancel_url"] = "https://thankyou.duoservers.com/";
      $parameters["orderrder_domains:domains"] = array("type" => "register", "sld" => $domain_name,"tld" => $domain_tld,"period" => 1, "domain" => $domain_t, "id_protect" => 0, "custom_nameservers" => 1, "ns1" => "dns1.supremedns.com", "ns2" => "dns2.supremedns.com", "ns3" => "dns3.supremedns.com", "ns4" => "dns4.supremedns.com", "orderrder_domains:domains:contacts" => $contacts);

      curl_setopt($curl, CURLOPT_POST, true);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($parameters));
      $response = curl_exec($curl);

      if (!$response = curl_exec($curl))
      return 'error2';

      $result = unserialize($response);
      if (!is_array($result))
      return 'error3';

      return $result[1];
      }

      if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
      $ip = $_SERVER['HTTP_CLIENT_IP'];
      } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
      $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
      } else {
      $ip = $_SERVER['REMOTE_ADDR'];
      }
      $info = command_domain('kiesin8520', $ip, 'us','alarmtechhelp','com');


      print_r($info);

      Comment


      • #4
        Could you open a ticket in your Resellers account and ask one of the technicians to look at it?

        BTW, in your Resellers CP have you it switched on and in advanced mode? Reseller Tools > API settings
        Last edited by clivejo; 1 hour ago.

        Comment

        Working...
        X