Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

dns api call

Hello ,

           can anyone help me out in designate api call , i am following the documentation ""

Here is my code

  $url = "";
  $tokenid = "12313wqw121212121";

  $header1=  "X-Auth-Token:".$tokenid;
  $header2 = "Host: $url"; 
  $header3 = "Accept: application/json";
  $header4 = "Content-Type: application/json";

        "name": "",
        "ttl": 3600,
        "email": ""

             $curl = curl_init();
     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     curl_setopt($curl, CURLOPT_POST, true);
     curl_setopt($curl, CURLOPT_URL, $url_send);
     curl_setopt($curl, CURLOPT_HTTPHEADER,array($header1,$header2,$header3,$header4));
     curl_setopt($curl, CURLOPT_HEADER, false);
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     curl_setopt($curl, CURLOPT_POSTFIELDS, $post);

     $response = curl_exec($curl);

The result i am getting here is "Authentication required " . Here i am passing the token-id for authentication bt still its throwing the Authentication error .Can anyone please suggest me where i am going wrong .

Regards , Lokesh.S