Once the module is enabled, scroll down and find an admin menu item ''Remote Api Permissions''. Click ''New Record''.&nbsp;You will see a form to fill - your comment about the access key, a generated access key itself, and list of checkboxes describing what system calls is available for given access key. Check necessary calls and Save.<br>

Once the module is enabled, scroll down and find an admin menu item ''Remote Api Permissions''. Click ''New Record''.&nbsp;You will see a form to fill - your comment about the access key, a generated access key itself, and list of checkboxes describing what system calls is available for given access key. Check necessary calls and Save.<br>

+

= Samples =

== Fetching list of users via Web API<br> ==

== Fetching list of users via Web API<br> ==

−

To try it out, open in your browser ''http://example.com/amember/api/users?_key=''<u>''APIKEY''</u>

+

To try it out, open in your browser ''http://example.com/amember/api/users?_key=APIKEY

You will see first 20 user records in JSON&nbsp;format and total number of users in ''_total'' variable

You will see first 20 user records in JSON&nbsp;format and total number of users in ''_total'' variable

Line 30:

Line 31:

;_nested[]

;_nested[]

−

:Requests to include nested records into dataset. For example, if you are accessing users database via REST, you can do it like this: ''http://example.com/amember/api/users?_key=''<u>''APIKEY''</u>&amp;format=xml&amp;_nested[]=invoices&amp;_nested=access This will include user's invoices and access records into output. List of available nested tables is unique to each record type.

+

:Requests to include nested records into dataset. For example, if you are accessing users database via REST, you can do it like this: <pre>http://example.com/amember/api/users?_key=APIKEY&amp;format=xml&amp;_nested[]=invoices&amp;_nested[]=access</pre> This will include user's invoices and access records into output. List of available nested tables is unique to each record type.

== Adding users via Web API<br> ==

== Adding users via Web API<br> ==

−

To add a customer via Web API, you have to use HTTP POST method. There is a sample call to add a user to database:

+

To add a customer via Web API, you have to use HTTP POST method. There is a sample call to add a user to database:

aMember Pro Web API (REST)

Since 4.2.6 release aMember Pro provides web api based on REST principles. It allows to fetch and submit information about users, products and payments. It is easy to extend and use, and we expect that list of interfaces will be extended soon.

Enabling of REST API

Go to aMember CP -> Setup -> Plugins, and enable "api" module. If your aMember installation has no "api" module available, you can get it for free in the members area

Once the module is enabled, scroll down and find an admin menu item Remote Api Permissions. Click New Record. You will see a form to fill - your comment about the access key, a generated access key itself, and list of checkboxes describing what system calls is available for given access key. Check necessary calls and Save.

Samples

Fetching list of users via Web API

You will see first 20 user records in JSON format and total number of users in _total variable

You can pass additional parameters to control output:

_format

Either: json (default), xml or serialize

_count

Number of records per page (default: 20, max: 100)

_page

Page of output (default: 0 - the first page)

_filter[FIELDNAME]

Adds a WHERE condition for FIELDNAME. If search value contains % it is considered as pattern for SQL LIKE expression, else SQL = condition is used. If several filters provided, it will be concatenated in SQL AND expression.

_nested[]

Requests to include nested records into dataset. For example, if you are accessing users database via REST, you can do it like this:

Product Categories

Product to Category Relations

Check Access

That is a special controller that allows to check user access by username, e-mail address or username-password pair. It ignores described above additional parameters and accepts only parameters described here. This controller always return results in JSON format.