WordPress Membership

Easy to use WordPress Membership plugin

  • Documentation
  • WP eMember Plugin
  • Projects
  • Home

API – Deactivate A Member Profile Using HTTP GET or POST

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 deactivate a member’s account profile using a HTTP GET or POST request then use this documentation. [Read more…]

Filed Under: Additional Resources Tagged With: 3rd party integration, API, emember extension, Integration, WP eMember

API – Querying A Member Profile Using HTTP GET or POST

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 query a member account profile using a HTTP GET or POST request then use this documentation. [Read more…]

Filed Under: Additional Resources Tagged With: 3rd party integration, API, emember extension, Integration, WP eMember

API – Updating A Member Account Using HTTP GET or POST

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 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:


It is very important that you do not reveal the Secret Word/API key to anyone else.

Using the API

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:

http://www.example.com/wp-content/plugins/wp-eMember/api/update.php

You need a minimum of 2 pieces of information to send an update request. These are:

  • Secret Word/API Key (you specified it in the settings menu of the plugin)
  • Member ID (the user whose details you want to update)

Optionally, you can pass the following fields with the request to update the values of those fields for the member’s account in question.

  • title
  • first_name
  • last_name
  • email
  • password
  • phone
  • address_street
  • address_city
  • address_state
  • address_zipcode
  • country
  • gender
  • company_name
  • membership_level_id
  • account_state
  • subscription_starts

1. Updating Member Account Using  HTTP GET request

In order to update a member account via HTTP GET request, use the following format:

http://www.example.com/wp-content/plugins/wp-eMember/api/update.php?secret_key=XX&member_id=XX&first_name=XX&last_name=XX

Replace the “example.com” and “XX” with the appropriate values.

PHP Code Example:The following is an example of how to construct this URL using PHP:

$secret_key = "6bd39ewe43a7bb";
$member_id= "1";
$first_name= "Jon";
$last_name= "Doe";

$prepared_data = "?secret_key=".$secret_key."&member_id=".$member_id."&first_name=".$first_name."&last_name=". $last_name;
$get_url = "http://www.example.com/wp-content/plugins/wp-eMember/api/update.php".$prepared_data;
// Execute this GET Request
file_get_contents($get_url);

2. Updating Member Account Using  HTTP POST request

To update a member account via HTTP POST use the following format:

<form method="post" action="http://www.example.com/wp-content/plugins/wp-eMmeber/api/update.php">
<input type="hidden" name="secret_key" value="XX">
<input type="hidden" name="member_id" value="XX">
<input type="hidden" name="first_name" value="XX">
<input type="hidden" name="last_name" value="XX">
<input type=submit value="Submit Post">
</form>

Replace the “example.com” and “XX” with the appropriate value.

Filed Under: Additional Resources Tagged With: 3rd party integration, API, emember extension, WP eMember

Member Registration Completion Hook

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.

The registration completion hook (eMember_registration_complete) gets triggered after a member completes the registration. It will pass the details of the user who just registered to the handling function.

Here is a sample code to show you how it works. You can use this code in your custom plugin to see how it passes the data.

function handle_custom_registration_complete_event($member_data,$custom_fields)
{
  //The following line will print all the member details that got passed to this function via the $member_data array.
  //You can use this data however you like it.
  print_r($member_data);
  echo "<br />Custom fields data shown below<br />";
  print_r($custom_fields);
}
add_action('eMember_registration_complete','handle_custom_registration_complete_event',10,2);

Filed Under: Additional Resources Tagged With: API, member, registration form

API – Creating A Member Account Using HTTP GET or POST

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.

WP eMember plugin has an API that allows you to create a member account using a standard HTTP GET or POST request.

Enabling the API

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:


It is very important that you do not reveal the Secret Word/API key to anyone else.

Using the API

Once you enable it, you can start to send HTTP request to the following URL to create member account remotely or from another software:

http://www.example.com/wp-content/plugins/wp-eMember/api/create.php

You need a minimum of 5 pieces of information to create a member account using a HTTP request. These are:

  • Secret Word/API Key (you specified it in the settings menu of the plugin)
  • First Name
  • Last Name
  • Email Address
  • Membership Level ID

Optionally, you can pass in the following data with the request (if you do not pass these, a randomly generated value will be used for these)

  • username
  • password

1. Creating Member Account Using  HTTP GET request

In order to create a member account via HTTP GET use the following format:

http://www.example.com/wp-content/plugins/wp-eMember/api/create.php?secret_key=XX&first_name=XX&last_name=XX&email=XX&membership_level_id=XX

Replace the ‘example.com’ and ‘XX’ with the appropriate values.

PHP Code Example:The following is an example of how to construct this link using PHP:

$secret_key = "6bd39ewe43a7bb";
$first_name= "Jon";
$last_name= "Doe";
$email= "[email protected]";
$membership_level_id= "1";
$prepared_data = "?secret_key=".$secret_key."&first_name=".$first_name."&last_name=". $last_name."&email=".$email."&membership_level_id=".$membership_level_id;
$get_url = "http://www.example.com/wp-content/plugins/wp-eMember/api/create.php".$prepared_data;
// Execute this GET Request
file_get_contents($get_url);

2. Creating Member Account Using  HTTP POST request

To create a member account via HTTP POST use the following format:

<form method="post" action="http://www.example.com/wp-content/plugins/wp-eMmeber/api/create.php">
<input type="hidden" name="secret_key" value="XX">
<input type="hidden" name="first_name" value="XX">
<input type="hidden" name="last_name" value="XX">
<input type="hidden" name="email" value="XX">
<input type="hidden" name="membership_level_id" value="XX">
<input type=submit value="Submit Post">
</form>

Replace the ‘example.com’ and ‘XX’ with the appropriate value.

Passing Additional Field Values

You can optionally pass additional field values using the following parameters in your request:

  • phone
  • address_street
  • address_city
  • address_state
  • address_zipcode
  • country
  • gender
  • company_name

Filed Under: Additional Resources, Integration Tagged With: 3rd party integration, API, Integration

Get the WP eMember Plugin

Get WP eMember

Categories

  • Additional Resources
  • Content Protection
  • Design & Usage
  • eMember Addon
  • Installation
  • Integration
  • License
  • Testing
  • Uncategorized
  • Video Tutorial

Recent Comments

  • Chris Brown on API – Querying A Member Profile Using HTTP GET or POST
  • admin on API – Updating A Member Account Using HTTP GET or POST
  • Chris Brown on API – Updating A Member Account Using HTTP GET or POST
  • admin on API – Updating A Member Account Using HTTP GET or POST
  • Andrea on API – Updating A Member Account Using HTTP GET or POST

Featured WordPress Plugins

wordpress_estore_icon
wordpress membership plugin icon
WP Express Checkout Plugin
WordPress Lightbox Ultimate Plugin
WordPress Photo Seller Plugin
wordpress_affiliate_plugin_icon

Copyright © 2023 | WP Membership Plugin