1. Terry Member

    Regist domain by php CURL(Errorcode:400)

    Topic geplaatst op: 23-09-2020 om 03:35

    When i use versio API and php CURL, the service return 400,the postDate in the demo
    I refer to https://www.versio.nl/RESTapidoc/#api-Domains-List
    running program, the domain registration has not been completed,and return a error code and message.
    my demo

    <?php
    $post_a = array(
    'contact_id'=>529254,
    'years'=>1
    );
    $curl = curl_init();
    curl_setopt($curl,CURLOPT_URL,'https://www.versio.nl/api/v1/domains/letone.be');
    curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
    curl_setopt($curl,CURLOPT_HTTPAUTH,CURLAUTH_BASIC);
    curl_setopt($curl,CURLOPT_USERPWD,"myaccout:mypwd");
    curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,false);
    curl_setopt($curl,CURLOPT_FOLLOWLOCATION,1);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $post_a);

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


    //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 ) )

    Reageer
  2. Er zijn nog geen reacties.