-
Notifications
You must be signed in to change notification settings - Fork 0
Jotta protocol 5 Events
Torbjorn Tyridal edited this page Mar 23, 2017
·
7 revisions
GET api.jottacloud.com/rest/token/<username>/createToken
User-Agent: Mozilla/5.0
x-auth-token: <token.access_token>
Return:
<token>
<username>...</username>
<authToken>...</authToken>
</token>
url: websocket.jottacloud.com
/ws/<token.username>/<token.authToken>
Communication is json objects
After protocol upgrade, send:
{"SUBSCRIBE":{
"path":"ALL",
"UA": "Desktop_Jottacloud.3.1.61.564.Windows_8.6.2.9200.x86_64"
}}
At appropriate intervals send
{'PING': 'Ok'}
{'SUBSCRIBE': {'LAST_UUID': 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx', 'PATH': 'ALL'}}
{'PONG': 'ok'}
The server will send Event messages as notifications to various actions on the jfs.
The Event message has a general form:
{"EVENT":{
"U":"<username>",
"A":"<username>",
"T":"PATH|META",
"ST":"<type>",
"TS":<timestamp>,
"D":{...},
"uuid":"<uuid>",
"unixnano":sssss.nnnnn},
"Length":nnn}
Field | Description |
---|---|
U | user name (of event receiver or object owner?) |
A | Acting user, typically same as U, but may be different for shared objects |
T | Target(?) can have value META or PATH depending on the event |
ST | Event reason/type CREATE_DEVICE , CREATE_DIR , MOVE_DIR NEW_UPLOAD , RESTORE_MP DELETE_DEVICE DELETE_MP DELETE_DIR DELETE HARD_DELETE_FILE INIT_SHARE_FOLDER ACCEPT_SHARE_FOLDER_INVITE SHARE_FILE UNSHARE_FILE (and the missing obvious ones, CREATE_MP etc) |
TS | Timestamp |
D | Data, ST dependent |
uuid | Event identifier ? |
unixnano | Timestamp, struct timespec as a float ? |
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/<folder>/<file>",
"actorDevice":"Jotta",
"created":"<iso-time>",
"dfs":"<????>",
"fileuuid":"<uuid>",
"md5":"<md5>",
"mimeType":"<mimetype>",
"modified":"<iso-time>",
"revision":"1",
"size":"377",
"updated":"<iso-time>",
"uuid":"<uuid>",
"x-id":"<someid>"},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/<folder>/<folder>",
"actorDevice":"WEBAPP",
"uuid":"<uuid>",
"x-id":"<someid>"},
T=PATH
"D":{
"FROM":"/<username>/<device>/null",
"uuid":"<uuid>",
"x-id":"<someid>"},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Sync/New folder",
"TO":"/<username>/Jotta/Sync/sharedfolder",
"actorDevice":"<devicename>",
"uuid":"","x-id":""},
T=PATH
'D': {
'uuid': '<uuid>',
'x-id': '<someid>',
'FROM': '/<username>/<device>/.../<item>'},
T=PATH
'D': {
'actorDevice': 'WEBAPP',
'uuid': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'x-id': '<someid>',
'FROM': '/<username>/<device>/null'},
T=PATH
'D': {
'uuid': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'x-id': '<someid>',
'FROM': '/<username>/<device>/<mountpoint>'},
T=PATH
'D': {
'actorDevice': 'WEBAPP',
'uuid': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'x-id': '<someid>',
'FROM': '/<username>/<device>/<mount>/.../<folder>'},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/<folder>/<file>",
"actorDevice":"WEBAPP",
"created":"<iso-time>",
"dfs":"<?????>",
"fileuuid":"<uuid>",
"md5":"<md5>",
"mimeType":"<mimetype>",
"modified":"<iso-time>",
"revision":"1",
"size":"377",
"updated":"<iso-time>",
"uuid":"<uuid>",
"x-id":"<someid>"},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/<folder>/<file>",
"actorDevice":"WEBAPP",
"uuid":"<uuid>",
"x-id":"<someid>"},
T=META
"D":{
"FROM":"/<username>/Jotta/Sync/sharedfolder",
"members":"",
"owner":"<username>",
"shareId":"<uuid1>",
"uuid":"<uuid2>",
"x-id":"<someid>"},
T=META
"D":{
"FROM":"/<userid>/Jotta/Sync/sharedfolder",
"members":"<other_userid>",
"owner":"<userid>",
"shareId":"<uuid1>",
"uuid":"<uuid2>",
"x-id":""},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/>folder>/<file>",
"actorDevice":"WEBAPP",
"uuid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"x-id":"<someid>"},
T=PATH
"D":{
"FROM":"/<username>/Jotta/Archive/<folder>/<file>",
"actorDevice":"WEBAPP",
"uuid":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx",
"x-id":"<someid>"},