what is $primary_id in remote api?

Discussion in 'Developers' Forum' started by gswartz, Jul 8, 2013.

  1. gswartz

    gswartz New Member

    I'm brand spankin' new to ispconfig and was asked to hook into the api to set up some dns entries for new sites that we create on our windows servers. I've been able to get the dns_cname_add and dns_zone_get methods working. But I'm not clear on the dns_cname_get method. The second parameter in the function is called $primary_id. I guessed that this was the cname I was looking up, so I tried plugging in one that I know is registered. However I was returned an empty array. I then tried sending in the same $params array that I used in the dns_cname_add but still get the same result. Does anyone have any examples of usage for the dns_cname_get method and specifically, what should I be sending in as the $primary_id? Thanks.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The primary ID Variable may either contain the primary ID of that table that you are working on. DNS Records are stored in the table dns_rr, so the primary of that table is the id column. If you want to search for a record, then you can pass a array as primary_id e.g.:

    $primary_id = array('name' => 'helloworld.tld', 'type' => 'CNAME');
  3. gswartz

    gswartz New Member

    Thank you. The parameter list was basically one of the things I tried to do but I must have had a typo somewhere because now it's working when I retried. Thanks again.

Share This Page