Skip to content

Instantly share code, notes, and snippets.

@pcdinh
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcdinh/b63a60e285707a1a84ef to your computer and use it in GitHub Desktop.
Save pcdinh/b63a60e285707a1a84ef to your computer and use it in GitHub Desktop.
FileString file sharing
POST /2.0/file
{
"file": {
"id": "<string>",
"location": {
"proto": "file",
"name": "<string>",
"path": "<string>",
"is_dir": false
},
"content": {
"file_format": 4,
"checksum": {
"origin": "<string>",
"encrypted": null|"<string>",
"converted": null|"<string>"
},
"size": {
"origin": <int>,
"encrypted": null|<int>,
"converted": null|<int>
}
},
"created_time": "<string>",
"modified_time": "<string>"
},
"loc": {
"lat": <float>|null,
"lon": <float>|null
},
"action": {
"share": {
"recipients": {
"filestring": ["<uid>", ...],
"emails": ["<string>", ...],
"groups": ["<group-id>", ...]
},
"sharing": {
"key": "<string>",
"file": {
"printable": true|false,
"watermarked": true|false,
"expired_time": null|"<string>",
"perms": ['reshare', 'view']
}
}
}
}
}
Response:
{
"meta": {},
"body": {
"rev": <int>,
"results": {
"<file-id-1>": {
"status": {
"code": 1,
"message": null
},
"performed": {
"<uid-1>": {
"change": "shared"|null,
"identity": "<string>",
"status": {
"code": <int>,
"message": null|"<string>"
}
},
"<uid-2>": {
"change": "shared"|null,
"identity": "<string>",
"status": {
"code": <int>,
"message": null|"<string>"
}
}
}
}, ...
}
}
}
Sample
{
"body":{
"rev":1,
"results":{
"4093eab6-449c-11e4-acef-00155de2e332":{
"status":{
"message":null,
"code":1
},
"performed":{
"6cf77769-d5d3-39fa-96f2-20dd9219250d":{
"status":{
"message":null,
"code":2
},
"change":"shared",
"identity":"pcdinh+3@filestring.com"
},
"97f430c0-5ab7-3d92-a6be-c3baa1d4c840":{
"status":{
"message":null,
"code":2
},
"change":"shared",
"identity":"pcdinh+2@filestring.com"
},
"2a25af76-d579-354c-8d76-6fd2722d1865":{
"status":{
"message":null,
"code":2
},
"change":"shared",
"identity":"pcdinh+0@filestring.com"
},
"4c0137b2-17e4-3fe0-87ed-ab4f3e185606":{
"status":{
"message":null,
"code":2
},
"change":"shared",
"identity":"pcdinh+1@filestring.com"
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment