{"id":237,"date":"2013-04-27T17:26:56","date_gmt":"2013-04-27T17:26:56","guid":{"rendered":"http:\/\/kb.digitalregistra.co.id\/?page_id=237"},"modified":"2018-01-25T02:42:50","modified_gmt":"2018-01-25T02:42:50","slug":"create-user","status":"publish","type":"page","link":"https:\/\/kb.srs-x.com\/en\/api\/user\/create-user","title":{"rendered":"Create User"},"content":{"rendered":"<p><a href=\"http:\/\/kb.srs-x.com\/id\/api\/user\/create-user\/\"><strong>Versi Bahasa Indonesia<\/strong><\/a><\/p>\n<h2>Description<\/h2>\n<p>Create new SRS-X user.<\/p>\n<h2>Query<\/h2>\n<p>user\/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 >user_username<\/td>\n<td >string(255)<\/td>\n<td >Required<\/td>\n<td >Username<\/td>\n<\/tr>\n\r\n<tr><td >user_password<\/td>\n<td >string(255)<\/td>\n<td >Required<\/td>\n<td >Password User<\/td>\n<\/tr>\n\r\n<tr><td >email<\/td>\n<td >String(63)<\/td>\n<td >optional<\/td>\n<td >Contact email<\/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 >company<\/td>\n<td >String(32)<\/td>\n<td >Optional<\/td>\n<td >Company Name<\/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 >postal_code<\/td>\n<td >String(8)<\/td>\n<td >Required<\/td>\n<td >Zip COde<\/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 >p_kdnegara<\/td>\n<td >String(14)<\/td>\n<td >Required<\/td>\n<td >Telephone country code, withour \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >p_kdarea<\/td>\n<td >String(14)<\/td>\n<td >Required<\/td>\n<td >Region code<\/td>\n<\/tr>\n\r\n<tr><td >phone<\/td>\n<td >String(14)<\/td>\n<td >Required<\/td>\n<td >Phone number<\/td>\n<\/tr>\n\r\n<tr><td >f_kdnegara<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Fax country code, withour \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >f_kdarea<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Fax region code<\/td>\n<\/tr>\n\r\n<tr><td >fax<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Fax number<\/td>\n<\/tr>\n<\/tbody><\/table><\/div>\n<h2>Return<\/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<h2>Example<\/h2>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\n$url = &quot;http:\/\/srb657.srs-x.com\/api\/user\/create&quot;;\r\n$params['username'] = 'apiusername';\r\n$params['password'] = hash('sha256','apipassword');\r\n$params['user_username'] = 'email@email.id';\r\n$params['user_password'] = '87asdfasdf';\r\n$params['fname'] = 'fname';\r\n$params['address'] = 'lname';\r\n$params['city'] = 'jakarta';\r\n$params['province'] = 'jakarta';\r\n$params['postal_code'] = '32424';\r\n$params['p_kdnegara'] = '62';\r\n$params['p_kdarea'] = '274';\r\n$params['phone'] = '446657';\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;userid&gt;11&lt;\/userid&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;Command Failed&lt;\/resultMsg&gt;\r\n  &lt;\/result&gt;\r\n&lt;\/epp&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Versi Bahasa Indonesia Description Create new SRS-X user. Query user\/create List Variable Return Example Example Response Succeed: Failed:<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":236,"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\/237"}],"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=237"}],"version-history":[{"count":9,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/237\/revisions"}],"predecessor-version":[{"id":1640,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/237\/revisions\/1640"}],"up":[{"embeddable":true,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/236"}],"wp:attachment":[{"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/media?parent=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}