changeset 1446:eab0cf9ab8bf beta

API docs
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 20 Aug 2011 18:34:25 +0300
parents c78f6bf52e9c
children ebb90cfdac83
files docs/api/api.rst docs/api/index.rst
diffstat 2 files changed, 56 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/api/api.rst	Sat Aug 20 18:34:25 2011 +0300
@@ -0,0 +1,55 @@
+.. _api:
+
+
+API
+===
+
+
+Starting from RhodeCode version 1.2 a simple API was implemented.
+There's one schema for calling all api methods. API is implemented
+with JSON protocol both ways. 
+
+
+Clients need to send JSON data in such format::
+
+    {
+        "api_key":"<api_key>",
+        "method":"<method_name>",
+        "args":{"<arg_key>":"<arg_val>"}
+    }
+
+Simply provide api_key for access and permission validation
+method is name of method to call
+and args is an key:value list of arguments to pass to method
+    
+.. note::
+    
+    api_key can be found in your user account page    
+    
+    
+And will receive JSON formatted answer::
+    
+    {
+        "result": "<result>", 
+        "error": null
+    }
+
+All responses from API will be `HTTP/1.0 200 OK`, if there's an error while
+calling api **error** key from response will contain failure description 
+and result will be null.
+
+API METHODS
++++++++++++
+
+    
+pull
+----
+
+Pulls given repo from remote location. Can be used to autmatically keep 
+remote repos upto date
+
+::
+    
+    method: "pull"
+    args: {"repo":<repo_name>}
+
--- a/docs/api/index.rst	Sat Aug 20 18:13:54 2011 +0300
+++ b/docs/api/index.rst	Sat Aug 20 18:34:25 2011 +0300
@@ -7,4 +7,4 @@
    :maxdepth: 3
 
    models
-    
\ No newline at end of file
+   api 
\ No newline at end of file