1. Terry Member

    Regist the domain Return:error->400

    Topic geplaatst op: 22-09-2020 om 12:53


  2. Terry Member
    Reactie geplaatst op: 22-09-2020 om 13:06

    When i use versio API and php CURL, the service return 400,but the postDate mabe not worng
    I refer to
    But the domain name registration has not been completed
    my demo

    $post_a = array(
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_a);

    $response = curl_exec($curl);
    $data = json_decode($response);

    //the first run,and the return
    //stdClass Object( [error] => stdClass Object ( [code] => 400 [message] => ObjectInvalid|Invalid years ameter )

    //the The next run result has always been
    //stdClass Object ( [error] => stdClass Object ( [code] => 400 [message] => ObjectNotAllowed|Domain registration already requested ) )

    Vond u dit antwoord nuttig?

  3. Luc Member
    Reactie geplaatst op: 11-10-2020 om 21:10

    I was able to reproduce this, seems like versio does not like bad requests and just denies you from registering it again?

    Vond u dit antwoord nuttig?

  4. Koen Member
    Reactie geplaatst op: 03-11-2020 om 20:24

    I have the same problem. I am trying to register a domain name using the API and I get the same errors:

    Error after first run:
    stdClass Object( [error] => stdClass Object ( [code] => 400 [message] => ObjectInvalid|Invalid years parameter )

    Error after second run:
    stdClass Object ( [error] => stdClass Object ( [code] => 400 [message] => ObjectNotAllowed|Domain registration already requested ) )

    Please not that I tried this with various domain names and they all give this error.
    Also, I tried both 1 and 2 as years parameter.

    Can someone explain what is wrong? Here is my code (very similar):


    $post = [
    'domain' => 'example.nl',
    'contact_id' => my_customer_number,
    'years' => 1,
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL,'https://www.versio.nl/api/v1/domains/example.nl');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($curl, CURLOPT_USERPWD, "$login:$password");
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
    curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
    $response = curl_exec($curl);
    $data = json_decode($response);

    /* Get the redirection URL */
    $redirectURL = curl_getinfo($curl,CURLINFO_EFFECTIVE_URL );
    $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);

    Vond u dit antwoord nuttig?