Services/Sync/Server/Archived/0.3/API: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 80: Line 80:
A WBO will always be accessible at the following URL. All URLs will have REST semantics:  
A WBO will always be accessible at the following URL. All URLs will have REST semantics:  


https://''server''/''prefix''/''version''/''user''/''collection''/''id''
'''https://''server''/''prefix''/''version''/''user''/''collection''/''id'' '''


'''GET''': Retrieve the object.  
'''GET''': Retrieve the object.  
Line 88: Line 88:
Other URLs will allow for structured access. All these support the 'start' and 'limit' parameters to allow for pagination:
Other URLs will allow for structured access. All these support the 'start' and 'limit' parameters to allow for pagination:


https://''server''/''prefix''/''version''/''user''/''collection''
'''https://''server''/''prefix''/''version''/''user''/''collection'' '''


'''GET''': Returns a list of ids associated with the collection.  
'''GET''': Returns a list of ids associated with the collection.  
Line 94: Line 94:
<br>'''DELETE''': Deletes all objects in this collection.
<br>'''DELETE''': Deletes all objects in this collection.


https://''server''/''prefix''/''version''/''user''/''collection''/parent/''id''
'''https://''server''/''prefix''/''version''/''user''/''collection''/parent/''id'' '''


'''GET''': Returns a list of ids that are children of the specified id.  
'''GET''': Returns a list of ids that are children of the specified id.  
Line 100: Line 100:
<br>'''DELETE''': Deletes the object in the collection with this ID and all of its children.
<br>'''DELETE''': Deletes the object in the collection with this ID and all of its children.


https://''server''/''prefix''/''version''/''user''/''collection''/since/''timestamp''
'''https://''server''/''prefix''/''version''/''user''/''collection''/since/''timestamp'' '''


'''GET''': Returns a list of ids modified within the collection since the timestamp given.  
'''GET''': Returns a list of ids modified within the collection since the timestamp given.  
<br>'''PUT''': No applicable function.
<br>'''PUT''': No applicable function.
<br>'''DELETE''': No applicable function.
<br>'''DELETE''': No applicable function.
http://server/prefix/version/user/collection/since/timestamp


= Payloads =
= Payloads =
Line 127: Line 124:
Public Key payloads must be unencrypted. Note that the key itself is still passphrase protected.
Public Key payloads must be unencrypted. Note that the key itself is still passphrase protected.


*key_data (required) - the private key, passphrase encrypted.
{| width="100%" cellpadding="3"
*public_key (required) - the URI to the public key associated with this private key.
|- style="background-color: #efefef;"
| style="background-color: #efefef;" | '''Parameter'''
| style="background-color: #efefef; width: 100px" | '''Default'''
| '''Description'''
|- valign="top"
| key_data
| required
| The private key, passphrase encrypted.
|- valign="top"
| public_key
| required
| The URI to the public key associated with this private key.
|}


Sample Private Key payload:
=== Sample ===
<pre>
<pre>
   "payload":  
   "payload":  
Line 145: Line 154:
Public Key objects must be unencrypted.
Public Key objects must be unencrypted.


*key_data (required) - the public key
{| width="100%" cellpadding="3"
*private_key (required) - the URI to the private key associated with this public key.
|- style="background-color: #efefef;"
 
| style="background-color: #efefef;" | '''Parameter'''
 
| style="background-color: #efefef; width: 100px" | '''Default'''
 
| '''Description'''
Sample Public Key payload:
|- valign="top"
| key_data
| required
| The public key
|- valign="top"
| private_key
| required
| The URI to the private key associated with this private key.
|}


=== Sample ===
<pre>  "payload":  
<pre>  "payload":  
   {
   {
Line 164: Line 182:
Cryptometa objects (type: "cryptometa") must be unencrypted.
Cryptometa objects (type: "cryptometa") must be unencrypted.


*algorithm (required) - A hash, containing a "name" key and associated value, and any additional data required for the algorithm, such as "salt" or "iv".
{| width="100%" cellpadding="3"
*keyring (required) - a hash in which the keys are URLs to publickey WERs and the values are the encryption string used with that key to encrypt this record. The keys may be fully qualified URLs, or relative to the id level (thus, just the id is acceptable)
|- style="background-color: #efefef;"
 
| style="background-color: #efefef;" | '''Parameter'''
| style="background-color: #efefef; width: 100px" | '''Default'''
| '''Description'''
|- valign="top"
| algorithm
| required
| A hash, containing a "name" key and associated value, and any additional data required for the algorithm, such as "salt" or "iv".
|- valign="top"
| keyring
| empty
| A hash in which the keys are URLs to publickey WERs and the values are the encryption string used with that key to encrypt this record. The keys may be fully qualified URLs, or relative to the id level (thus, just the id is acceptable)
|}


Sample crypto-meta payload:
=== Sample ===
<pre>
<pre>
   "payload":  
   "payload":  
canmove, Confirmed users
1,173

edits