Drive sync
16 routes. Paths are relative to https://api.intersink.com/v1.
- GET/drive/sharesYour shared links (?target_id)
- POST/drive/sharesShare: { target_type: file|sync_file|asset, target_id, expires_in (s) | expires_at, max_downloads?, password?, label? } → token once
- DELETE/drive/shares/{id}Revoke a link now
- POST/drive/shares/open/{token}Open a shared link (anyone with it): { password? } → signed URLs
- PUT/drive/sync/v1/blocks/{id}Store one block (application/octet-stream, ≤ 16 MiB). Plain: id = SHA-256 of the bytes. Encrypted: X-Block-Encrypted: 1 and X-Block-Sha256 of the ciphertext.
- POST/drive/sync/v1/blocks/checkWhich of these blocks the server lacks: { blocks: [id…] } → { missing } (≤ 2000)
- POST/drive/sync/v1/blocks/urlsSigned download links for blocks you hold: { blocks: [id…] } (≤ 2000)
- GET/drive/sync/v1/changesChanges after ?cursor (0 = from the start), oldest first: { changes, cursor, has_more }
- GET/drive/sync/v1/filesCurrent files (?prefix=/folder/, ?limit, ?offset)
- GET/drive/sync/v1/files/{id}One file with its block list
- POST/drive/sync/v1/files/{id}/diffThe file's block list and the blocks you lack: { have: [block ids you hold] }
- POST/drive/sync/v1/files/{id}/restoreRestore a kept version as the newest one: { version }
- GET/drive/sync/v1/files/{id}/versionsKept versions (the last 20)
- POST/drive/sync/v1/files/commitCommit a version: { path, base_version (0 = new), blocks, size?, content_hash?, encrypted?, enc_header?, client_mtime? }; 409 on a conflict
- POST/drive/sync/v1/files/deleteDelete: { path, base_version }
- POST/drive/sync/v1/files/moveMove or rename: { from, to, base_version }
Store one block (application/octet-stream, ≤ 16 MiB). Plain: id = SHA-256 of the bytes. Encrypted: X-Block-Encrypted: 1 and X-Block-Sha256 of the ciphertext.
PUT/drive/sync/v1/blocks/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is of type object.
Which of these blocks the server lacks: { blocks: [id…] } → { missing } (≤ 2000)
POST/drive/sync/v1/blocks/check
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is not described in the spec yet.
Signed download links for blocks you hold: { blocks: [id…] } (≤ 2000)
POST/drive/sync/v1/blocks/urls
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is not described in the spec yet.
Changes after ?cursor (0 = from the start), oldest first: { changes, cursor, has_more }
GET/drive/sync/v1/changes
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is not described in the spec yet.
Current files (?prefix=/folder/, ?limit, ?offset)
GET/drive/sync/v1/files
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is not described in the spec yet.
One file with its block list
GET/drive/sync/v1/files/{id}
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is of type object.
The file's block list and the blocks you lack: { have: [block ids you hold] }
POST/drive/sync/v1/files/{id}/diff
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is of type object.
Restore a kept version as the newest one: { version }
POST/drive/sync/v1/files/{id}/restore
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is of type object.
Kept versions (the last 20)
GET/drive/sync/v1/files/{id}/versions
Needs a signed-in user (Bearer token or access_token cookie).
Parameters
| Name | Type | Description |
|---|---|---|
| idrequired | string, path |
Response
200. The payload in data is not described in the spec yet.
Commit a version: { path, base_version (0 = new), blocks, size?, content_hash?, encrypted?, enc_header?, client_mtime? }; 409 on a conflict
POST/drive/sync/v1/files/commit
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is of type object.
Delete: { path, base_version }
POST/drive/sync/v1/files/delete
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is of type object.
Move or rename: { from, to, base_version }
POST/drive/sync/v1/files/move
Needs a signed-in user (Bearer token or access_token cookie).
Response
200. The payload in data is of type object.