Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
en:syces:api_hidden [2015/08/04 08:47] co created |
en:syces:api_hidden [2016/09/13 09:31] (current) co |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== SyCes API ====== | ====== SyCes API ====== | ||
| - | based on Json RPC via HTTPS | + | === 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 === | ||
| + | Our [[en: | ||
| + | |||
| + | JSON-RPC (JavaScript Object Notation Remote Procedure Call) is a simple remote procedure call protocol encoded in JSON. | ||
| + | |||
| + | 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 === | ||
| + | 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 " | ||
| + | |||