User Tools

Site Tools


developers:remote_api:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developers:remote_api:start [2011/08/12 14:52]
mdavis [Using a Sample Client File]
developers:remote_api:start [2015/07/10 17:47] (current)
geojames [Using a Sample Client File]
Line 22: Line 22:
 | user.get | user.get_client.php | Gets a user's registration data, looked up by username OR e-mail address. | | 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/disabled) of that user | | user.changeStatus | user.changeStatus_client.php | Uses a user's remote API token to change the status (login enabled/disabled) of that user |
 +| user.listings.active | user.listings.active_client.php | Gets a list of active listings for specific seller.  API call added in **version 6.0.4** |
 +| user.listings.expired | user.listings.expired_client.php | Gets a list of expired listings for specific seller.  API call added in **version 6.0.4** |
 +| 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  | | 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.count | users.count_client.php | Returns the number of registered users on the site |
Line 28: Line 31:
 | groups.list | groups.list_client.php | Returns a list of user groups 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.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 33: Line 37:
 View the source on any of the sample client files.  Each one will have in-line comments on how to use it, along with variables that you will have to set to use it. View the source on any of the sample client files.  Each one will have in-line comments on how to use it, along with variables that you will have to set to use it.
  
-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 "common" set of instructions that apply to most of the stand-along sample scripts.+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 "common" set of instructions that apply to most of the stand-alone sample scripts.
  
 **Code snippet from one of the files in classes/api/_samples/**:\\ **Code snippet from one of the files in classes/api/_samples/**:\\
Line 58: Line 62:
 */</code> */</code>
  
 +==== Sample Setup ====
 +
 +
 +The initial steps would be to take one of the files within the remote samples directory found here in the file set:
 +
 +  /classes/api/_samples/
 +
 +and move it to where you would like that api call to be on your site.  Lets take the following file:
 +
 +   category.list_client.php
 +   
 +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://example.com/remote_api_calls/get_categories.php
 +  
 +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:
 +
 +<code>
 +//location of the XMLRPC.class.php file.  If calling the script from the _samples folder, leave this setting at the default.
 +$xmlrpc_location = '../classes/rpc/XMLRPC.class.php';
 +
 +//url of geo_api.php file, something like "https://mysite.com/geo_api.php"
 +//Note: recommended to use https for a secure connection, but if your server does not have SSL, you can use http instead.
 +$website = "https://example.com/geo_api.php";
 +
 +//Site's API key.  You can find the site's API key on the home page in the admin.
 +$api_key = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
 +
 +</code>
 +
 +You would pull the api key for the get_categories.php call (copied from "category.list_client.php") from the following configuration in the admin tool:
 +
 +  SITE SETUP > REMOTE API SECURITY KEYS > core.category.list
 +  
 +And you would paste that key directly into that file where the "x's" are above.  That should be all the configurations in that file for that call.  If all calls are in the same location the paths should be the same.  Only the api key should change for each as each remote is different.  The core.category.list call happens to require "parent" to be passed into it.  That would be the parent category id of the subcategories to get.  So given the above urls the call to get the main categories would be:
 +
 +  http://example.com/remote_api_calls/get_categories.php?parent=0
 +  
 +Each call requires it's own data and supplies it's own data in the response.  You'll need to get to know each to create a call for each.
 ===== Calls Created by Addons ===== ===== Calls Created by Addons =====
 Note that you can create a new API call, inside of an addon.  As long as that addon is installed and enabled, you will be able to use the API call. Note that you can create a new API call, inside of an addon.  As long as that addon is installed and enabled, you will be able to use the API call.
developers/remote_api/start.1313160767.txt.gz · Last modified: 2014/09/25 16:55 (external edit)