{"id":642,"date":"2015-03-26T06:33:15","date_gmt":"2015-03-26T06:33:15","guid":{"rendered":"http:\/\/kb.srs-x.com\/en\/?page_id=642"},"modified":"2017-08-30T03:20:48","modified_gmt":"2017-08-30T03:20:48","slug":"check-host","status":"publish","type":"page","link":"https:\/\/kb.srs-x.com\/en\/api\/host\/check-host","title":{"rendered":"Check Host"},"content":{"rendered":"<h2>Description<\/h2>\n<p>Check host availability.<\/p>\n<h2>Query<\/h2>\n<p>host\/check<\/p>\n<h2>List Variable<\/h2>\n<div class=\"table-responsive\"><table  style=\"width:100%; \"  class=\"easy-table easy-table-cuscosky \" >\n<thead>\r\n<tr><th >Name<\/th>\n<th >Data Type<\/th>\n<th > Required\/Optional<\/th>\n<th >Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\r\n<tr><td >hostname<\/td>\n<td >String(63)<\/td>\n<td >Required<\/td>\n<td >Child nameserver name\u00a0<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n<h2>Example<\/h2>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n$post[&quot;username&quot;] = 'apiusername';\r\n$post[&quot;password&quot;] = hash('sha256','apipassword');\r\n$post[&quot;hostname&quot;] = 'ns1.domainid.co.id'\r\n$url = 'http:\/\/[reseller url]\/api\/host\/check';\r\n\r\n$ch = curl_init();\r\ncurl_setopt($ch, CURLOPT_URL, $apiurl);\r\ncurl_setopt($ch, CURLOPT_POST, 1);\r\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\r\n$response = curl_exec($ch);\r\ncurl_close($ch);\r\n<\/pre>\n<h2>Example Response<\/h2>\n<p>Available:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;\r\n&lt;epp&gt;\r\n  &lt;result&gt;\r\n    &lt;resultCode&gt;1000&lt;\/resultCode&gt;\r\n    &lt;resultMsg&gt;Command Complete Successfully&lt;\/resultMsg&gt;\r\n  &lt;\/result&gt;\r\n  &lt;resultData&gt;\r\n    &lt;check&gt;Available&lt;\/check&gt;\r\n  &lt;\/resultData&gt;\r\n&lt;\/epp&gt;\r\n\r\n<\/pre>\n<p>Taken:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;\r\n&lt;epp&gt;\r\n  &lt;result&gt;\r\n    &lt;resultCode&gt;1000&lt;\/resultCode&gt;\r\n    &lt;resultMsg&gt;Command Complete Successfully&lt;\/resultMsg&gt;\r\n  &lt;\/result&gt;\r\n  &lt;resultData&gt;\r\n    &lt;check&gt;Taken&lt;\/check&gt;\r\n  &lt;\/resultData&gt;\r\n&lt;\/epp&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Description Check host availability. Query host\/check List Variable Example Example Response Available: Taken:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":68,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/642"}],"collection":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/comments?post=642"}],"version-history":[{"count":5,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/642\/revisions"}],"predecessor-version":[{"id":1425,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/642\/revisions\/1425"}],"up":[{"embeddable":true,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/68"}],"wp:attachment":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/media?parent=642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}