{"id":60,"date":"2012-09-17T04:02:38","date_gmt":"2012-09-17T04:02:38","guid":{"rendered":"http:\/\/kb.digitalregistra.co.id\/?page_id=60"},"modified":"2018-01-25T02:38:27","modified_gmt":"2018-01-25T02:38:27","slug":"create-contact","status":"publish","type":"page","link":"https:\/\/kb.srs-x.com\/en\/api\/contact\/create-contact","title":{"rendered":"Create Contact"},"content":{"rendered":"<p><a href=\"http:\/\/kb.srs-x.com\/id\/api\/contact\/create-contact\/\"><strong>Versi Bahasa Indonesia<\/strong><\/a><\/p>\n<h2>Description<\/h2>\n<p>Create new contact data.<\/p>\n<h2>Query<\/h2>\n<p>contact\/create<\/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 >userid<\/td>\n<td >String(32)<\/td>\n<td >Required<\/td>\n<td >User ID<\/td>\n<\/tr>\n\r\n<tr><td >fname<\/td>\n<td >String(32)<\/td>\n<td >Required<\/td>\n<td >First name<\/td>\n<\/tr>\n\r\n<tr><td >lname<\/td>\n<td >String(32)<\/td>\n<td >Optional<\/td>\n<td >Last name<\/td>\n<\/tr>\n\r\n<tr><td >email<\/td>\n<td >String(63)<\/td>\n<td >Required<\/td>\n<td >Contact email<\/td>\n<\/tr>\n\r\n<tr><td >company<\/td>\n<td >String(32)<\/td>\n<td >Required<\/td>\n<td >Company name, use \"personal\" for personal account<\/td>\n<\/tr>\n\r\n<tr><td >address<\/td>\n<td >String(255)<\/td>\n<td >Required<\/td>\n<td >Address<\/td>\n<\/tr>\n\r\n<tr><td >address2<\/td>\n<td >String(255)<\/td>\n<td >Optional<\/td>\n<td >Address 2<\/td>\n<\/tr>\n\r\n<tr><td >address3<\/td>\n<td >String(255)<\/td>\n<td >Optional<\/td>\n<td >Address 3<\/td>\n<\/tr>\n\r\n<tr><td >city<\/td>\n<td >String(32)<\/td>\n<td >Required<\/td>\n<td >City name<\/td>\n<\/tr>\n\r\n<tr><td >province<\/td>\n<td >String(32)<\/td>\n<td >Required<\/td>\n<td >Province\/State<\/td>\n<\/tr>\n\r\n<tr><td >phone-cc<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Country code without \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >phone<\/td>\n<td >String(14)<\/td>\n<td >Required<\/td>\n<td >Phone number without \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >fax-cc<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Country code without \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >fax<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Fax number, including country code, without \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >country<\/td>\n<td >String(3)<\/td>\n<td >Required<\/td>\n<td >Country code, ie : ID, MY, SG, AU<\/td>\n<\/tr>\n\r\n<tr><td >postal_code<\/td>\n<td >String(8)<\/td>\n<td >Required<\/td>\n<td >Zip code<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n<h2><strong>Return<\/strong><\/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 >Type<\/th>\n<\/tr>\n<\/thead>\n<tbody>\r\n<tr><td >domainid<\/td>\n<td >String[0-9]{4-16}<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n<p>Example<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\n$post[&quot;username&quot;] = 'apiusername';\r\n$post[&quot;password&quot;] = hash('sha256','apipassword');\r\n$post[&quot;userid&quot;] = '34'\r\n$post[&quot;fname&quot;] = 'Nemo'\r\n$post[&quot;lname&quot;] = 'Nemo'\r\n$post[&quot;email&quot;] = 'nemo@domain.co.id'\r\n$post[&quot;company&quot;] = 'personal'\r\n$post[&quot;address&quot;] = 'Sesame street no. 33'\r\n$post[&quot;city&quot;] = 'Sleman'\r\n$post[&quot;province&quot;] = 'DIY'\r\n$post[&quot;phone&quot;] = '6243434'\r\n$post[&quot;fax&quot;] = '6243434'\r\n$post[&quot;country&quot;] = 'ID'\r\n$post[&quot;postal_code&quot;] = '54321'\r\n$url = 'http:\/\/[reseller url ]\/api\/contact\/create';\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>Succeed:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&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;nickhandle&gt;01206gp3&lt;\/nickhandle&gt;\r\n    &lt;contactid&gt;20&lt;\/contactid&gt;\r\n  &lt;\/resultData&gt;\r\n&lt;\/epp&gt;\r\n<\/pre>\n<p>Failed:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\r\n&lt;epp&gt;\r\n&lt;result&gt;\r\n&lt;resultCode&gt;1001&lt;\/resultCode&gt;\r\n&lt;resultMsg&gt;Respon Failed&lt;\/resultMsg&gt;\r\n&lt;\/result&gt;\r\n&lt;\/epp&gt;\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Versi Bahasa Indonesia Description Create new contact data. Query contact\/create List Variable Return Example Example Response Succeed: Failed:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":58,"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\/60"}],"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=60"}],"version-history":[{"count":19,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/60\/revisions"}],"predecessor-version":[{"id":1620,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/60\/revisions\/1620"}],"up":[{"embeddable":true,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/58"}],"wp:attachment":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/media?parent=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}