API¶
Alle Aufrufe gehen per JSON-RPC (1.0) per HTTP-POST an die selbe URL:
-
POST
https://www.scoutnet.de/jsonrpc/server.php
¶
Die Doku zu den Funktionen ist fast direkt kopiert aus dem Server-Code.
-
get_data_by_global_id
(global_id[, query])¶ Return Data
Parameter: - global_id (array|string) – Global id for which we want elements
- query (object) – Query to filter the elements
Rückgabe: Elemente als Attribute eines Objects - die Namen sind zusammengesetzt aus Typen und IDs
-
checkPermission
(type, global_id, username, auth)¶ Checks if user has permission for object
Parameter: - type (string) – type of the record
- global_id (integer) – global Id of the object to check for
- username (string) – username of the User
- auth (string) – JSON-serialized array containing the a timestamp and two hashes(sha1 and md5) of the three other parameters which is encrypted with AES-CBC with the Users Api key and IV=1234567890123456
Rückgabe: 0 if object is stored, 1 if user is not allow, 2 if an other error occured
-
requestPermission
(type, global_id, username, auth)¶ Request permission for object
Parameter: - type (string) – Type of Record
- global_id (integer) – Global id of Object to request for
- username (string) – Username
- auth (string) – JSON-serialized array containing the a timestamp and two hashes(sha1 and md5) of the three other parameters which is encrypted with AES-CBC with the Users Api key and IV=1234567890123456
Rückgabe: 0 if object is stored
-
setData(type,id,object,username,auth
()¶ Writes Data to scoutnet
Parameter: - type (string) – this is the type of the record
- id (integer) – the unique id of the object (if this is -1 the object is created)
- object (object) – the object itself
- username (string) – the username of the user
- auth (string) – JSON-serialized array containing the a timestamp and two hashes(sha1 and md5) of the four other parameters which is encrypted with AES-CBC with the Users Api key and IV=1234567890123456
Rückgabe: 0 if object is stored, 1 if user is not allow, 2 if an other error occured
-
deleteObject
(type, global_id, id, username, auth)¶ Deletes object from scoutnet
Parameter: - type (string) – this is the type of the record
- global_id (integer) – the global id for the object
- id (integer) – the unique id of the object
- username (string) – the username of the user
- auth (string) – JSON-serialized array containing the a timestamp and two hashes(sha1 and md5) of the three other parameters which is encrypted with AES-CBC with the Users Api key and IV=1234567890123456
Rückgabe: 0 if object is stored, 1 if user is not allow, 2 if an other error occured
Die Erzeugung des Auth-Strings ist etwas kompliziert aber sie sollte funktionieren wie in sn_rpc.py