no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision Next revision | |||
— | api_documentation [2013-02-27 20:06] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Feng Office API Developer' | ||
+ | ===== Description ===== | ||
+ | |||
+ | Feng Office API provides a powerful and simple Web Service interface to interact with your Feng Office installation. It's based on a RESTful and Stateless web service, over JSON Internet Media Type. | ||
+ | |||
+ | ===== Parameters ===== | ||
+ | |||
+ | Base URI (or Endpoint) | ||
+ | Endpoint URL: FENGOFFICE_URL/ | ||
+ | |||
+ | If your Feng Office installation is accessible by the following url: http:// | ||
+ | |||
+ | |||
+ | ===== Method ===== | ||
+ | |||
+ | This version counts with the following methods so that they can be invoked: | ||
+ | |||
+ | * get_object | ||
+ | * list_members | ||
+ | * listing | ||
+ | * save_object | ||
+ | * trash | ||
+ | * complete_task | ||
+ | |||
+ | To invoke a remote method you need to make a request to the following URL: | ||
+ | http:// | ||
+ | |||
+ | When invoking a service, the best way would be to create a handler first. Then, you would have to call it from the handler through the API client, where all the functions are going to be at: | ||
+ | |||
+ | Example of how to invoke the function **completeTask** while standing on the API client, and calling the API Controller in the core: | ||
+ | |||
+ | <file php api_invocation_example.php> | ||
+ | /** | ||
+ | * Complete Task passed as argument | ||
+ | * If status = 1 : complete it. Otherwise repoen it | ||
+ | * @param int $id | ||
+ | */ | ||
+ | public function completeTask($id, | ||
+ | $action = ($status)?' | ||
+ | $request = $this-> | ||
+ | return $this-> | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | endPoint = URL where your Feng Office source code is at | ||
+ | |||
+ | |||
+ | **NOTES:** | ||
+ | - The URL must finish with a slash!! | ||
+ | - If your server has mod rewrite disabled, the url to invoke is: | ||
+ | http:// | ||
+ | |||
+ | |||
+ | |||
+ | ===== Authentication ===== | ||
+ | |||
+ | Each web service request must include a GET parameter ‘auth’ containing a hash of the user password. This hash is the user token generated automatically when user is created. | ||
+ | |||
+ | ===== Common Parameters ===== | ||
+ | |||
+ | The common parameters that must be included on each request: | ||
+ | GET[version]: | ||
+ | Each method accepts different arguments from GET or POST depending on the implementation. Look at the method specifications for further information. | ||
+ | |||
+ | |||
+ | ===== Method Specification ===== | ||
+ | ^ Name ^ GET ^ | ||
+ | ^ get_object | ||
+ | ^ list_members | ||
+ | ^ trash | **id:** integer - required | | boolean | Trashes a given object | | ||
+ | ^ complete_task | **id:** integer - required \\ action: string – ' | ||
+ | ^ listing | **srv:** object type handler – required \\ **args:** array \\ //order_dir \\ order \\ members \\ rested_by_id \\ assigned_to status// | | array | Generic list for Feng Office content objects | | ||
+ | ^ save_object | **srv: | ||
+ | |||
+ | ===== Examples ===== | ||
+ | | ||
+ | Message List: | ||
+ | URL: http:// | ||
+ | |||
+ | RESPONSE: | ||
+ | |||
+ | [ | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | } | ||
+ | ] | ||
+ | |