Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:syces:api_hidden [2015/08/05 09:29] co |
en:syces:api_hidden [2016/09/13 09:31] (current) co |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== SyCes API ====== | ====== SyCes API ====== | ||
+ | === Requirements === | ||
+ | Only regular clients can use the API. Furthermore you require an api-key. We will also store a default tariff and the default type of username if you specify them. | ||
+ | |||
=== Protocol === | === Protocol === | ||
- | Our SyCes-API uses the JSON-RPC protocol, version 2.0. | + | Our |
JSON-RPC (JavaScript Object Notation Remote Procedure Call) is a simple remote procedure call protocol encoded in JSON. | JSON-RPC (JavaScript Object Notation Remote Procedure Call) is a simple remote procedure call protocol encoded in JSON. | ||
- | You must call the API via HTTPS. | + | You must call the [[en: |
+ | === Usage === | ||
+ | == Request == | ||
+ | Clients need to send a request object to our server with | ||
+ | the following properties: | ||
+ | |||
+ | * jsonrpc: a string containing the JSON RPC version, currently " | ||
+ | * method: a string with the name of the method to be invoked | ||
+ | * params: an array of objects to be passed as parameters to the defined method | ||
+ | * id: a unique string to match the response with the request that it is replying to | ||
+ | (could be a combination of sessionid + sequence) | ||
+ | |||
+ | == Response == | ||
+ | the response object contains the following properties | ||
+ | |||
+ | * jsonrpc: a string containing the JSON RPC version, currently " | ||
+ | * result: | ||
+ | * error: | ||
+ | * id: the id of the request it is responding to | ||
+ | |||
=== Authentication === | === Authentication === | ||
+ | You need to a valid token for any api call. It can be retrieved by calling the authenticate-method. | ||
+ | |||
+ | === Examples === | ||
+ | request { " | ||
+ | result for valid credentials { " | ||
+ | result for invalid credentials { " | ||
+ | |||
+ | === Example using curl === | ||
+ | curl -i -k -H " | ||
+ | |||