{"id":301,"date":"2013-05-01T09:24:21","date_gmt":"2013-05-01T09:24:21","guid":{"rendered":"http:\/\/kb.digitalregistra.co.id\/?page_id=301"},"modified":"2021-05-06T07:17:07","modified_gmt":"2021-05-06T07:17:07","slug":"update-user","status":"publish","type":"page","link":"https:\/\/kb.srs-x.com\/en\/api\/user\/update-user","title":{"rendered":"Update User"},"content":{"rendered":"\n<p><a href=\"http:\/\/kb.srs-x.com\/id\/api\/user\/update-user\/\"><strong>Versi Bahasa Indonesia<\/strong><\/a><\/p>\n<h2>Description<\/h2>\n<p>Update user data. But not for changing user&#8217;s password.<\/p>\n<h2>Query<\/h2>\n<p>user\/update<\/p>\n<h2>List Variable<\/h2>\n\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(255)<\/td>\n<td >Required<\/td>\n<td >Username<\/td>\n<\/tr>\n\r\n<tr><td >user_username<\/td>\n<td >string(255)<\/td>\n<td >Optional<\/td>\n<td >Username<\/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 >Optional<\/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 >Optional<\/td>\n<td >Address<\/td>\n<\/tr>\n\r\n<tr><td >address2<\/td>\n<td >String(255)<\/td>\n<td >Optional (must include address) <\/td>\n<td >Address 2<\/td>\n<\/tr>\n\r\n<tr><td >address3<\/td>\n<td >String(255)<\/td>\n<td >Optional (must include address2)<\/td>\n<td >Address 3<\/td>\n<\/tr>\n\r\n<tr><td >city<\/td>\n<td >String(32)<\/td>\n<td >Optional<\/td>\n<td >City name<\/td>\n<\/tr>\n\r\n<tr><td >province<\/td>\n<td >String(32)<\/td>\n<td >Optional<\/td>\n<td >Province\/State<\/td>\n<\/tr>\n\r\n<tr><td >postal_code<\/td>\n<td >String(8)<\/td>\n<td >Optional<\/td>\n<td >Zip Code<\/td>\n<\/tr>\n\r\n<tr><td >country<\/td>\n<td >String(3)<\/td>\n<td >Optional<\/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 >Optional<\/td>\n<td >Telephone county code, without \"+\"<\/td>\n<\/tr>\n\r\n<tr><td >p_kdarea<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/td>\n<td >Region code<\/td>\n<\/tr>\n\r\n<tr><td >phone<\/td>\n<td >String(14)<\/td>\n<td >Optional<\/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<\/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\n<h2>Example<\/h2>\n\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\n$url = \"http:\/\/srb657.srs-x.com\/api\/user\/update\";\n$params['username'] = 'apiusername';\n$params['password'] = hash('sha256','apipassword');\n$params['userid'] = '45';\n$params['user_username'] = 'email@email.id';\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $apiurl);\ncurl_setopt($ch, CURLOPT_POST, 1);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));\n\n$response = curl_exec($ch);\ncurl_close($ch);\n<\/pre>\n<h2>Example Response<\/h2>\n<p>Succeed:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;epp&gt;\n  &lt;result&gt;\n    &lt;resultCode&gt;1000&lt;\/resultCode&gt;\n    &lt;resultMsg&gt;Command Complete Successfully&lt;\/resultMsg&gt;\n  &lt;\/result&gt;\n&lt;\/epp&gt;\n<\/pre>\n<p>Failed:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n&lt;epp&gt;\n  &lt;result&gt;\n    &lt;resultCode&gt;1001&lt;\/resultCode&gt;\n    &lt;resultMsg&gt;Command Failed&lt;\/resultMsg&gt;\n  &lt;\/result&gt;\n&lt;\/epp&gt;\n<\/pre>\n\n","protected":false},"excerpt":{"rendered":"<p>Versi Bahasa Indonesia Description Update user data. But not for changing user&#8217;s password. Query user\/update List Variable 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\/301"}],"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=301"}],"version-history":[{"count":13,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/301\/revisions"}],"predecessor-version":[{"id":1818,"href":"https:\/\/kb.srs-x.com\/en\/wp-json\/wp\/v2\/pages\/301\/revisions\/1818"}],"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=301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}