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.
It 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.
What's Needed
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.0 and Higher are the latest and recommended versions) 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
Technology Used
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
- JSON
- XML
This makes it easy to write web applications and desktop applications alike.
System Requirements
This API requires WishList Member 2.61.1022 or higher (WishList Member 3.0 and Higher are the latest and recommended versions) installed on a server running Apache, PHP 5.2.4 or higher, PHP cURL 7.19.7 or higher, and MySQL 8.0 or higher
REST Methods
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 |
---|---|
POST | Create |
GET | Read |
PUT | Update |
DELETE | Delete |
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
Where:
yourblog.com | URL where you installed WordPress that's running WishList Member |
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):
Return Format | URL |
---|---|
XML | http://yourblog.com/?/wlmapi/2.0/xml/resources |
PHP Serialized | http://yourblog.com/?/wlmapi/2.0/php/resources |
JSON | http://yourblog.com/?/wlmapi/2.0/json/resources |
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.
More details can be found in the API Knowledge Base article.