Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:syces:api_hidden [2015/08/12 09:37]
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  [[en:syces:api_hidden:rpcs| SyCes-API]]  uses the JSON-RPC protocol, version 2.0. Our  [[en:syces:api_hidden:rpcs| SyCes-API]]  uses the JSON-RPC protocol, version 2.0.
Line 27: Line 30:
        
 === Authentication === === Authentication ===
-You need to a valid sessionid for any api call. It can be retrieved by calling the authenticate-method with your username and password.+You need to a valid token for any api call. It can be retrieved by calling the authenticate-method.
  
-=== Example ===+=== Examples ===
 request { "jsonrpc": "2.0", "method": "authenticateByRealm", "params": {"api_key": "231af78...", "realm": "clientdomain.de"}, "id": 1}\\ request { "jsonrpc": "2.0", "method": "authenticateByRealm", "params": {"api_key": "231af78...", "realm": "clientdomain.de"}, "id": 1}\\
-result for valid credentials { "jsonrpc": "2.0", "result": "0252rkcf5jm2rop8rtbnno4og5", "id": 1}\\+result for valid credentials { "jsonrpc": "2.0", "result": {"token": "0252rkcf5jm2rop8rtbnno4og5"}, "id": 1}\\
 result for invalid credentials { "jsonrpc": "2.0", "code": 20, "error": {"message": "Invalid credentials."}, "id": 1} result for invalid credentials { "jsonrpc": "2.0", "code": 20, "error": {"message": "Invalid credentials."}, "id": 1}
 +
 +=== Example using curl ===
 +curl -i -k -H "Accept: application/json" -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0", "method": "authenticateByRealm", "params": {"api_key": "abc...", "realm": "clientdomain"}, "id": 1}' 'https://host:port'
  
  
QR Code
QR Code SyCes API (generated for current page)