This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
developers:remote_api:start [2008/12/30 00:13] jonyo |
developers:remote_api:start [2015/07/10 17:47] (current) geojames [Using a Sample Client File] |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
====== Remote API ====== | ====== Remote API ====== | ||
Line 14: | Line 15: | ||
| session.touch | session.touch_client.php | Update the "last active" | | session.touch | session.touch_client.php | Update the "last active" | ||
| session.destroy | session.destroy_client.php | Removes a particular session. | | session.destroy | session.destroy_client.php | Removes a particular session. | ||
+ | | session.get | session.get_client.php | Gets an array of session data based on session ID, IP, and user agent | | ||
| user.register | user.register_client.php | Register a new user. Note that the normal checks are still done (with the exception of the security image), and that registration " | | user.register | user.register_client.php | Register a new user. Note that the normal checks are still done (with the exception of the security image), and that registration " | ||
| user.edit | user.edit_client.php | Edits a user's information, | | user.edit | user.edit_client.php | Edits a user's information, | ||
| user.exists | user.exists_client.php | Check to see if a username or e-mail exists or not. | | | user.exists | user.exists_client.php | Check to see if a username or e-mail exists or not. | | ||
| user.getToken | user.getToken_client.php | Gets a user's remote API token that can then be used in other remote API calls, such as user.edit. | | | user.getToken | user.getToken_client.php | Gets a user's remote API token that can then be used in other remote API calls, such as user.edit. | | ||
+ | | user.get | user.get_client.php | Gets a user's registration data, looked up by username OR e-mail address. | | ||
+ | | user.changeStatus | user.changeStatus_client.php | Uses a user's remote API token to change the status (login enabled/ | ||
+ | | user.listings.active | user.listings.active_client.php | Gets a list of active listings for specific seller. | ||
+ | | user.listings.expired | user.listings.expired_client.php | Gets a list of expired listings for specific seller. | ||
+ | | user.listings.favorite | user.listings.favorite_client.php | Gets a list of favorite listings for specific user. API call added in **version 6.0.4** | | ||
+ | | system.getSetting | system.getSetting_client.php | Gets the value of a specified internal setting | ||
+ | | users.count | users.count_client.php | Returns the number of registered users on the site | | ||
+ | | users.list | users.list_client.php | Returns a list of registered users on the site | | ||
+ | | category.list | category.list_client.php | Returns a list of categories on the site | | ||
+ | | groups.list | groups.list_client.php | Returns a list of user groups on the site | | ||
+ | | listing.search | listing.search_client.php | Searches the database of listings for a given keyword, optionally in a given category | | ||
+ | | listing.get | listing.get_client.php | Gets the details and images for a given listing | | ||
===== Using a Sample Client File ===== | ===== Using a Sample Client File ===== | ||
Line 23: | Line 37: | ||
View the source on any of the sample client files. | View the source on any of the sample client files. | ||
- | Each sample file is a **fully working standalone script** that makes use of the applicable remote API call, but you must follow the instructions to set it up. For your reference, here are the " | + | Each sample file is a **fully working standalone script** that makes use of the applicable remote API call, but you must follow the instructions to set it up. For your reference, here are the " |
+ | **Code snippet from one of the files in classes/ | ||
<code php>/* | <code php>/* | ||
Note: This is intended for people that are familiar with editing PHP | Note: This is intended for people that are familiar with editing PHP | ||
Line 34: | Line 49: | ||
$xmlrpc_location = " | $xmlrpc_location = " | ||
2. Set the rest of the " | 2. Set the rest of the " | ||
- | Each setting has it' | + | Each setting has its own instructions right above it. |
There may be optional settings as well, those can be set by | There may be optional settings as well, those can be set by | ||
Line 47: | Line 62: | ||
*/</ | */</ | ||
+ | ==== Sample Setup ==== | ||
+ | |||
+ | |||
+ | The initial steps would be to take one of the files within the remote samples directory found here in the file set: | ||
+ | |||
+ | / | ||
+ | |||
+ | and move it to where you would like that api call to be on your site. Lets take the following file: | ||
+ | |||
+ | | ||
+ | |||
+ | You can move to a specific location on your site where you want all your api calls to sit. You could rename that file to anything you like. Let say I renamed the file and placed it here on my site: | ||
+ | |||
+ | http:// | ||
+ | | ||
+ | Once there configure everything within the top of that file. Lets assume the Geo software is installed in the following location and that I have not moved the XMLRPC.class.php file. The configurations in that file would be: | ||
+ | |||
+ | < | ||
+ | //location of the XMLRPC.class.php file. If calling the script from the _samples folder, leave this setting at the default. | ||
+ | $xmlrpc_location = ' | ||
+ | |||
+ | //url of geo_api.php file, something like " | ||
+ | //Note: recommended to use https for a secure connection, but if your server does not have SSL, you can use http instead. | ||
+ | $website = " | ||
+ | |||
+ | // | ||
+ | $api_key = ' | ||
+ | |||
+ | </ | ||
+ | |||
+ | You would pull the api key for the get_categories.php call (copied from " | ||
+ | |||
+ | SITE SETUP > REMOTE API SECURITY KEYS > core.category.list | ||
+ | | ||
+ | And you would paste that key directly into that file where the " | ||
+ | |||
+ | http:// | ||
+ | | ||
+ | Each call requires it's own data and supplies it's own data in the response. | ||
===== Calls Created by Addons ===== | ===== Calls Created by Addons ===== | ||
Note that you can create a new API call, inside of an addon. | Note that you can create a new API call, inside of an addon. |