# HG changeset patch # User Marcin Kuzminski # Date 2011-08-20 17:34:25 # Node ID eab0cf9ab8bffaf6a96eea120f008af274c76410 # Parent c78f6bf52e9c26cf154cc0c1f6e2d15e4a230be4 API docs diff --git a/docs/api/api.rst b/docs/api/api.rst new file mode 100644 --- /dev/null +++ b/docs/api/api.rst @@ -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":"", + "method":"", + "args":{"":""} + } + +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": "", + "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":} + diff --git a/docs/api/index.rst b/docs/api/index.rst --- a/docs/api/index.rst +++ b/docs/api/index.rst @@ -7,4 +7,4 @@ API Reference :maxdepth: 3 models - \ No newline at end of file + api \ No newline at end of file