How to check if domain is exist with DA API

HSG

Verified User
Joined
Oct 7, 2015
Messages
31
Hi,
I want to check if domain is exist with DirectAdmin API.
I use this:

PHP:
$sock = new HTTPSocket;
$sock->connect(SERVER_IP, 2222);
$sock->set_login('username', 'password');
$sock->set_method('POST');
$sock->query('/CMD_API_DNS_ADMIN', array('domain' => 'domain', 'action' => 'exists'));
$result = $sock->fetch_parsed_body();

But $result return a full directadmin page on echo instead the exist.

What is problem?
 
I found problem.
Problem is I using a reseller account login information.
This API only works with admin account information.

Very Thanks.
 
Back
Top