The API allows you to remotely connect to your ppSD2 installation from a server other than the one ppSD2 is installed on. Using this feature, you can manage and update your database, authenticate users, and create subscriptions from remote servers.
General Rules
All dates use the YYYY-MM-DD format. Status codes for accounts are:
- A: Active
- C: Paused
- E: Expired
Lifetime accounts should use date "9999-12-01".
API Setup
The following files need to be uploaded to the "ppSD2/api" folder on the primary server where your ppSD2 control panel is located:
- receive.php
The following files need to be uploaded to the server from which you are making the API call:
- ppsd2_api.php
When creating a custom PHP script that will use the API, always load the ppsd2_api.php file:
require "ppsd2_api.php"; $ppsd2api = new ppsd2;
The following changes are required to the "ppsd2_api.php" file. Edit the variables located under the "Custom Settings" section of the file:
- <b>$curl_proxy</b>: If cURL requires a proxy on your server, input it here.
- <b>$api_location</b>: The full URL to the "receive.php" file.
- <b>$token</b>: Custom security token required on both ends of the API.
- <b>$license_key</b>: Your ppSD2 license key. This can be found within the "ppSD2/admin/license.php" file on your primary server.
When establishing a custom token, make sure that it is a random series of numbers and upper/lower case letters, and at least 20 characters in length.
- <b>Example</b>: DFJ38fe9g3F9ekf0GEG8
The following changes are required to the "receive.php" file:
- Copy the custom token that was created on the "ppsd2_api.php" file to the $token variable on the "receive.php" file.
Available Commands
Accounts
- create
- view
- edit
Shopping Cart
- create_subscription
- cancel_subscription
Sample Code
Sample PHP code is provided with the API ZIP file.
Last updated on 11 July 2011 11:15am
