The WishList Member Application Programming Interface (API) version 2.0 provides an easy way for third-party developers to create applications that interact with some of the functionalities of WishList Member.
If is this document’s goal to provide developers with as much as information as possible about the API.
Examples will be provided using the PHP scripting language.
In order to make the API work, a developer must have access to the following:
- A copy of WishList Member 2.61.1022 or higher (WishList Member 3.1 is the latest version) installed and activated on a WordPress install.
- cURL if using PHP or an equivalent library that allows transferring of HTTP data and cookie handling if using a different language
- Average programming skills
Talking to the API
Applications must make use of Representational State Transfer or REST to communicate with the WishList Member API. Any programming language that supports REST (which is pretty much everything) can be used.
The reason for choosing REST over other transfer protocols is its simplicity. One simply needs to construct a valid URL to call the API and send data using the regular HTTP methods GET, POST, PUT and DELETE.
Data Return Format
To make it simple, the WishList Member API returns data in three different and widely used formats, namely:
- Serialized PHP Data
This makes it easy to write web applications and desktop applications alike.
This API requires WishList Member 2.61.1022 or higher (WishList Member 3.1 is the latest version) installed on a server running Apache, PHP 5.2.4 or higher, PHP cURL 7.19.7 or higher, and MySQL 5.0 or higher
The API makes use of four HTTP methods which we call verbs. Each method is equivalent to an action that is to be performed by the API. They are:
|Method (Verb)||Equivalent Action|
Quick Example Using GET
The WishList Member API 2.0 can be accessed by going to: http://yourblog.com/?/wlmapi/2.0/return_format/resource_name
|yourblog.com||URL where you installed WordPress that’s running WishList
|return_format||Can be xml, php or json|
|resource_name||The resource you wish to access|
Give it a try by going to any of the following URLs in your web browser (be sure to replace yourblog.com with the correct URL):
If you chose XML, then you should get output similar to the following:
What we just did was made a GET request to the API using your browser and yes, it’s that easy.