REST

From aMember Pro Documentation
Revision as of 08:37, 18 June 2012 by Alex-scott (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Fetching list of users via Web API

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 format and total number of users in _total variable

You can pass additional parameters to control output:

_format
Either: json (default), xml or php
_count
Number of records per page (default: 20, max: 100)
_page
Page of output (default: 0 - the first page)

You can also setup filters for dataset: