-
Notifications
You must be signed in to change notification settings - Fork 27
Web Storage API JSON Data Structures
Ken Manheimer edited this page Apr 19, 2013
·
4 revisions
Examples of various web storage api v1 data structures.
Accounts are associated with one or more backup devices. The devices are located within its' accounts login URL, with the form:
https://server.domain/storage/b32username/
where b32username is a non-padded base32 encoding of the account name.
{"stats": { "firstname": "ken", "lastname": "whoever", "devices": 2, "backupsize": "1.784 GB", "billing_url": "https://spideroak.com/user/validate?hmac=69...", "size": 3 }, "devices": [{ "encoded": "Some%20Laptop%20Computer/", "name": "Some Laptop Computer", "lastlogin": 1335452245, "lastcommit": 1335464711}, { "encoded": "Server%20%2F%20Colorful/", "name": " Server / Colorful", "lastlogin": 1335464648, "lastcommit": 1335464699 }] }
{dirs: [ ["display name of folder", "subfolder/"] ], files:[ {"url": "relative url to download file", "name": "filename", "size": <file size in bytes>, "ctime": <unix timestamp creation time>, "mtime": <unix timestamp modification time>, "preview_25": "relative url of 25px file preview, if available", "preview_48": "relative url of 48px file preview, if available", "preview_228": "relative url of 228px file preview, if available", "preview_800": "relative url of 800px file preview, if available", "versions": <number of historical versions available> } ] }
In the web storage API v1, share rooms are served via the storage server
{ "stats": { "start_date": null, "room_name": "This is the name of the room", "room_description": "This is a long description of the room", "number_of_files": <integer number of all files in the share>, "number_of_folders": <integer number of all folders in the share>, "firstname": "the users's first name", "lastname": "the users's last name" }, { "dirs": [ ["display name of folder", "path/to/folder/"] ] } }
Access to the list of share rooms published by an account is restricted to the account, while access to the share room elements depends on having the account's shareid and room_key.
The location of the list lives within the accounts storage root URL, and has the form:
https://server.domain/storage/b32username/shares
Note that, as with the storage URL itself, the server domain may be different than the primary storage server.
{ "share_id":"ashareid", "share_id_b32": "MFZWQYLSMVUWI", "share_rooms": [{ "room_description": "This sentence no verb.", "room_key": "aroomkey", "room_name":"Random stuff for testing", "url": "/browse/share/ashareid/aroomkey" }, { "room_description":"etc", "room_key":"roomkeytoo", "room_name":"Whatever", "url":"/browse/share/ashareid/roomkeytoo" }] }