Rest API 3.1 dns_zone_get

Discussion in 'Developers' Forum' started by gody, Oct 20, 2016.

  1. gody

    gody Member

    Hi,
    I’m trying to work with the new API but i have some difficulties.
    I found your rest_exemple.php file

    I can :
    - get client info à $client_result = restCall('client_get', array('session_id' => $session_id, 'client_id' => array('customer_no' => '111')));
    - get function list à $func_result = restCall('get_function_list', array('session_id' => $session_id));
    - get dns zone by name à $dns_result_id = restCall('dns_zone_get_id', array('session_id' => $session_id, 'origin' => mydomain));
    o Not working with subdomain delegation ​

    I can’t get specific info like dns zone, i don’t understand how to call them.
    $dns_result = restCall('dns_zone_get', array('session_id' => $session_id, 'id' => 1));
    $dns_result = restCall('dns_zone_get', array('session_id' => $session_id, 1));
    $dns_result = restCall('dns_zone_get', array('session_id' => $session_id, array('id' => 1)));
    $dns_result = restCall('dns_zone_get', array('session_id' => $session_id, 'id' => array('id' => 1)));

    I try with CURL command line too but same result:
    curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"session_id": "XXXX","client_id": "","params": {"id": 1}}' "https://ISP:8080/remote/json.php?dns_zone_get" -k


    Every try give me: {"code":"ok","message":"","response":[]}

    What i’m doing wrong ?
     
  2. gody

    gody Member

    Found ...
    $dns_result_id = restCall('dns_zone_get', array('session_id' => $session_id, 'primary_id' =>2));
    and with curl
    curl -X POST -H "Content-Type: application/json" -H "Cache-Control: no-cache" -d '{"session_id": "XXXXX","primary_id":2}' "https://ISP:8080/remote/json.php?dns_zone_get" -k
     

Share This Page