How to Remove a User using the Rest API (Remote Site)

  1. Overview
  2. Automation for WPCourseware
  3. Remove a User
  4. How to Remove a User using the Rest API (Remote Site)

In version 1.2, we introduced the rest API method for enrolling and removing users from a course. This method is simple and secure and allows your flowmattic or other automation not to be installed on the same Wordpress site as your WPCourseWare Instance.

Once 1.2 is installed, you will find a new menu in settings called 'WPC Automation' When opening, you will see a new admin menu that looks like the below:

For Removal, you need to set an API key, which can be custom or randomly generated using button (2) this, when set, will be your X-WPC-Automation-Key, which should be named as such and in your header to authenticate your requests to enroll or remove a user from a course

The API URL is available for you to copy in (5)

You then need to set your Automator up to include the following information (Below is a Flowmattic Screenshot)

You need to take the API endpoint (5) from above and paste it into (1), AND you need to make sure you are sending as a JSON with parameters; your API key should be set as in this example at (2) The mandatory parameters are below and they are the only parameters available.

  • Email
  • Course-id (this is the published course id, not the page or post id,) i.e 2 in the example below

This will allow you to remove a user using the rest API using the plugin.


Was this article helpful?