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; 05-12-2019, 06:08 PM.

    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 and also have the funds available in your wallet to pay for the registration?
        Last edited by clivejo; 11-12-2019, 12:48 AM.

        Comment


        • #5
          Hi clivejo,
          Thank you for your help.
          I have try putting in tickets. but all they say is "We are not developers and are API is working fine".
          I have sent then, asking for help. They told me it was not on there side and I do not know what I am doing. I only been coding for about 15 year or so.
          I have tried there api folder that is in the zip file and that is not working. I have tried to tell them and again all they can tell me is " We are not developers. We can not help."
          To said I have tried alot to that point I come it the forum for help.
          Yes my API is setup for advanced mode.

          Comment


          • #6
            You have funds in your wallet to pay for it? Also, is the client/username you are using a valid client in YOUR resellers account?

            From what I understand a domain can't be ordered on it's own. You have to append it to an existing user/client account already created in your resellers account. You can sell domains only, but you have to order the Domain Manager plan as a way for your customer/client to control and manage the domain on the system.

            Comment


            • #7
              Hi clivejo,
              I do have money in the wallet to pay for the domain (IF IT WORK)
              THe user I am test this on have a Domain Manager plan.
              Thank you

              Comment

              Working...
              X