{"id":933,"date":"2014-02-06T17:09:49","date_gmt":"2014-02-07T00:09:49","guid":{"rendered":"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/?p=933"},"modified":"2019-03-14T22:57:37","modified_gmt":"2019-03-15T05:57:37","slug":"api-updating-a-member-account-using-http-get-or-post","status":"publish","type":"post","link":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933","title":{"rendered":"API \u2013 Updating A Member Account Using HTTP GET or POST"},"content":{"rendered":"<p><span style=\"color: #ff0000;\"><em><strong>This documentation is only for developers. If you are not a developer with good PHP coding skills then you have no need to read this.<\/strong><\/em><\/span><\/p>\n<p>If you want to update a member account using a HTTP GET or POST request then use this documentation.<\/p>\n<h2>Enabling the API<\/h2>\n<p>WP eMember plugin has an API that allows you to update a member account using a standard HTTP GET or POST request. If you want to use this API then you need to enable it from the settings menu of the plugin first. The following is a screenshot of this section in the settings menu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-448\" title=\"emember-3rd-party-integration\" src=\"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg\" alt=\"\" width=\"558\" height=\"159\" srcset=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg 698w, https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration-300x85.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><br \/>\nIt is very important that you do not reveal the Secret Word\/API key to anyone else.<\/p>\n<h2>Using the\u00a0API<\/h2>\n<p>Once you enable it, you can start to send HTTP request to the following URL to update member accounts remotely or from another software\/application:<\/p>\n<pre>http:\/\/www.example.com\/wp-content\/plugins\/wp-eMember\/api\/update.php\r\n<\/pre>\n<p>You need a minimum of 2 pieces of information to send an update request. These are:<\/p>\n<ul>\n<li>Secret Word\/API Key (you specified it in the settings menu of the plugin)<\/li>\n<li>Member ID (the user whose details you want to update)<\/li>\n<\/ul>\n<p>Optionally, you can pass the following fields with the request to update the values of those fields for the member&#8217;s account in question.<\/p>\n<ul>\n<li>title<\/li>\n<li>first_name<\/li>\n<li>last_name<\/li>\n<li>email<\/li>\n<li>password<\/li>\n<li>phone<\/li>\n<li>address_street<\/li>\n<li>address_city<\/li>\n<li>address_state<\/li>\n<li>address_zipcode<\/li>\n<li>country<\/li>\n<li>gender<\/li>\n<li>company_name<\/li>\n<li>membership_level_id<\/li>\n<li>account_state<\/li>\n<li>subscription_starts<\/li>\n<\/ul>\n<h2>1. Updating Member Account Using \u00a0HTTP GET request<\/h2>\n<p>In order to update a member account via HTTP GET request, use the following format:<\/p>\n<pre>http:\/\/www.example.com\/wp-content\/plugins\/wp-eMember\/api\/update.php?secret_key=XX&amp;member_id=XX&amp;first_name=XX&amp;last_name=XX<\/pre>\n<p>Replace the \u201cexample.com\u201d and \u201cXX\u201d with the appropriate values.<\/p>\n<p><strong>PHP Code Example:<\/strong>The following is an example of how to construct this URL using PHP:<\/p>\n<pre>$secret_key = \"6bd39ewe43a7bb\";\r\n$member_id= \"1\";\r\n$first_name= \"Jon\";\r\n$last_name= \"Doe\";\r\n\r\n$prepared_data = \"?secret_key=\".$secret_key.\"&amp;member_id=\".$member_id.\"&amp;first_name=\".$first_name.\"&amp;last_name=\". $last_name;\r\n$get_url = \"http:\/\/www.example.com\/wp-content\/plugins\/wp-eMember\/api\/update.php\".$prepared_data;\r\n\/\/ Execute this GET Request\r\nfile_get_contents($get_url);<\/pre>\n<h2>2. Updating Member Account Using \u00a0HTTP POST request<\/h2>\n<p>To update a member account via HTTP POST use the following format:<\/p>\n<pre>&lt;form method=\"post\" action=\"http:\/\/www.example.com\/wp-content\/plugins\/wp-eMmeber\/api\/update.php\"&gt;\r\n&lt;input type=\"hidden\" name=\"secret_key\" value=\"XX\"&gt;\r\n&lt;input type=\"hidden\" name=\"member_id\" value=\"XX\"&gt;\r\n&lt;input type=\"hidden\" name=\"first_name\" value=\"XX\"&gt;\r\n&lt;input type=\"hidden\" name=\"last_name\" value=\"XX\"&gt;\r\n&lt;input type=submit value=\"Submit Post\"&gt;\r\n&lt;\/form&gt;<\/pre>\n<p>Replace the \u201cexample.com\u201d and \u201cXX\u201d with the appropriate value.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This documentation is only for developers. If you are not a developer with good PHP coding skills then you have no need to read this. If you want to update a member account using a HTTP GET or POST request then use this documentation. Enabling the API WP eMember plugin has an API that allows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[14],"tags":[43,42,76,5],"class_list":{"0":"post-933","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-additional-resources","7":"tag-3rd-party-integration","8":"tag-api","9":"tag-emember-extension","10":"tag-wp-emember","11":"entry"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>API \u2013 Updating A Member Account Using HTTP GET or POST - WordPress Membership<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd\"},\"headline\":\"API \u2013 Updating A Member Account Using HTTP GET or POST\",\"datePublished\":\"2014-02-07T00:09:49+00:00\",\"dateModified\":\"2019-03-15T05:57:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\"},\"wordCount\":323,\"commentCount\":12,\"image\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg\",\"keywords\":[\"3rd party integration\",\"API\",\"emember extension\",\"WP eMember\"],\"articleSection\":[\"Additional Resources\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\",\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\",\"name\":\"API \u2013 Updating A Member Account Using HTTP GET or POST - WordPress Membership\",\"isPartOf\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg\",\"datePublished\":\"2014-02-07T00:09:49+00:00\",\"dateModified\":\"2019-03-15T05:57:37+00:00\",\"author\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage\",\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg\",\"contentUrl\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg\",\"width\":\"698\",\"height\":\"199\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API \u2013 Updating A Member Account Using HTTP GET or POST\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#website\",\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/\",\"name\":\"WordPress Membership\",\"description\":\"Easy to use WordPress Membership plugin\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g\",\"caption\":\"admin\"},\"url\":\"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"API \u2013 Updating A Member Account Using HTTP GET or POST - WordPress Membership","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#article","isPartOf":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933"},"author":{"name":"admin","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd"},"headline":"API \u2013 Updating A Member Account Using HTTP GET or POST","datePublished":"2014-02-07T00:09:49+00:00","dateModified":"2019-03-15T05:57:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933"},"wordCount":323,"commentCount":12,"image":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage"},"thumbnailUrl":"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg","keywords":["3rd party integration","API","emember extension","WP eMember"],"articleSection":["Additional Resources"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933","url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933","name":"API \u2013 Updating A Member Account Using HTTP GET or POST - WordPress Membership","isPartOf":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage"},"image":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage"},"thumbnailUrl":"http:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg","datePublished":"2014-02-07T00:09:49+00:00","dateModified":"2019-03-15T05:57:37+00:00","author":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd"},"breadcrumb":{"@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#primaryimage","url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg","contentUrl":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-content\/uploads\/2011\/12\/emember-3rd-party-integration.jpg","width":"698","height":"199"},{"@type":"BreadcrumbList","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/api-updating-a-member-account-using-http-get-or-post-933#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/"},{"@type":"ListItem","position":2,"name":"API \u2013 Updating A Member Account Using HTTP GET or POST"}]},{"@type":"WebSite","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#website","url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/","name":"WordPress Membership","description":"Easy to use WordPress Membership plugin","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/#\/schema\/person\/d68b2ffa792aeb141f10f910dacccfdd","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3a21ab4072e533cf470d80fc2f0fd3639872824ade4e23709397e109b24f8857?s=96&d=identicon&r=g","caption":"admin"},"url":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":0,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tipsandtricks-hq.com\/wordpress-membership\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}