Skip to content

Commit 8535127

Browse files
author
Qiming Yuan
committed
Update public spec.
- Authentication - Add token/revoke endpoint. - Account - Add disabled field to Account. - Files - Add include_deleted and include_has_explicit_shared_members parameter to get_metadata and list_folder endpoint. - Add close parameter to upload_session/start endpoint to support explicitly close an upload session. - Add upload_session/append_v2 endpoint which provides explicit session close support. upload_session/append endpoint is now deprecated. - Add copy_reference endpoint. - Add get_temporary_link endpoint. - Shared links - Add remove_expiration parameter to modify_shared_link_settings endpoint. - Shared folders - Add leave_a_copy to FolderAction. - Add time_invited to SharedFolderMetadata. - Return is_osx_package or inside_osx_package error when user attempts to share an OS X package or folder inside OS X package. - Business endpoints - member_count is now optional in GroupSummary. - devices/list_team_devices endpoint is now deprecated by devices/list_member_devices. - linked_apps/list_team_linked_apps is now deprecated by linked_apps/list_members_linked_apps endpoint. - Add return_members parameter to groups/members/set_access_type endpoint.
1 parent 5229864 commit 8535127

14 files changed

+655
-202
lines changed

auth.babel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ union AuthError
1010
other*
1111
"An unspecified error."
1212

13+
route token/revoke(Void, Void, Void)
14+
"Disables the access token used to authenticate the call."

files.babel

Lines changed: 166 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace files
33

44
import common
55
import users
6+
import properties
67

78
alias Id = String(min_length=1)
89
alias Path = String(pattern="/.*")
@@ -176,6 +177,16 @@ struct FileMetadata extends Metadata
176177
"Additional information if the file is a photo or video."
177178
sharing_info FileSharingInfo?
178179
"Set if this file is contained in a shared folder."
180+
property_groups List(properties.PropertyGroup)?
181+
"Additional information if the file has custom properties with the
182+
property template specified."
183+
has_explicit_shared_members Boolean?
184+
"This flag will only be present if include_has_explicit_shared_members
185+
is true in :route:`list_folder` or :route:`get_metadata`. If this
186+
flag is present, it will be true if this file has any explicit shared
187+
members. This is different from sharing_info in that this could be true
188+
in the case where a file has explicit members but is not contained within
189+
a shared folder."
179190

180191
example default
181192
id = "id:a4ayc_80_OEAAAAAAAAAXw"
@@ -187,6 +198,8 @@ struct FileMetadata extends Metadata
187198
server_modified = "2015-05-12T15:50:38Z"
188199
rev = "a1c10ce0dd78"
189200
size = 7212
201+
property_groups = [default]
202+
has_explicit_shared_members = false
190203

191204
struct FolderMetadata extends Metadata
192205
id Id
@@ -195,13 +208,17 @@ struct FolderMetadata extends Metadata
195208
"Deprecated. Please use :field:`sharing_info` instead."
196209
sharing_info FolderSharingInfo?
197210
"Set if the folder is contained in a shared folder or is a shared folder mount point."
211+
property_groups List(properties.PropertyGroup)?
212+
"Additional information if the file has custom properties with the
213+
property template specified."
198214

199215
example default
200216
id = "id:a4ayc_80_OEAAAAAAAAAXz"
201217
path_lower = "/homework/math"
202218
path_display = "/Homework/math"
203219
name = "math"
204220
sharing_info = default
221+
property_groups = [default]
205222

206223
struct DeletedMetadata extends Metadata
207224
"Indicates that there used to be a file or folder at this path, but it no longer exists."
@@ -221,6 +238,12 @@ struct GetMetadataArg
221238
"The path of a file or folder on Dropbox."
222239
include_media_info Boolean = false
223240
"If true, :field:`FileMetadata.media_info` is set for photo and video."
241+
include_deleted Boolean = false
242+
"If true, :type:`DeletedMetadata` will be returned for deleted file or
243+
folder, otherwise :field:`LookupError.not_found` will be returned."
244+
include_has_explicit_shared_members Boolean = false
245+
"If true, the results will include a flag for each file indicating whether or not
246+
that file has any explicit members."
224247

225248
example default
226249
path = "/Homework/math"
@@ -294,6 +317,9 @@ struct ListFolderArg
294317
"If true, :field:`FileMetadata.media_info` is set for photo and video."
295318
include_deleted Boolean = false
296319
"If true, the results will include entries for files and folders that used to exist but were deleted."
320+
include_has_explicit_shared_members Boolean = false
321+
"If true, the results will include a flag for each file indicating whether or not
322+
that file has any explicit members."
297323

298324
example default
299325
path = "/Homework/math"
@@ -419,6 +445,8 @@ union UploadSessionLookupError
419445
closed
420446
"You are attempting to append data to an upload session that
421447
has alread been closed (i.e. committed)."
448+
not_closed
449+
"The session must be closed before calling upload_session/finish_batch."
422450
other*
423451
"An unspecified error."
424452

@@ -427,11 +455,22 @@ union UploadSessionFinishError
427455
"The session arguments are incorrect; the value explains the reason."
428456
path WriteError
429457
"Unable to save the uploaded contents to a file."
458+
too_many_shared_folder_targets
459+
"The batch request commits files into too many different shared folders.
460+
Please limit your batch request to files contained in a single shared folder."
430461
other*
431462
"An unspecified error."
432463

433464
# Req/Resp
434465

466+
struct UploadSessionStartArg
467+
close Boolean = false
468+
"If true, current session will be closed. You cannot do
469+
:route:`upload_session/append` any more to current session"
470+
471+
example with_close
472+
close = true
473+
435474
struct UploadSessionStartResult
436475
session_id String
437476
"A unique identifier for the upload session. Pass this to
@@ -441,7 +480,7 @@ struct UploadSessionStartResult
441480
example default
442481
session_id = "1234faaf0678bcde"
443482

444-
route upload_session/start (Void, UploadSessionStartResult, Void)
483+
route upload_session/start (UploadSessionStartArg, UploadSessionStartResult, Void)
445484
"Upload sessions allow you to upload a single file using multiple requests.
446485
This call starts a new upload session with the given data. You can
447486
then use :route:`upload_session/append` to add more data and
@@ -453,6 +492,28 @@ route upload_session/start (Void, UploadSessionStartResult, Void)
453492
host="content"
454493
style="upload"
455494

495+
struct UploadSessionAppendArg
496+
cursor UploadSessionCursor
497+
"Contains the upload session ID and the offset."
498+
close Boolean = false
499+
"If true, current session will be closed. You cannot do
500+
:route:`upload_session/append` any more to current session"
501+
502+
example default
503+
cursor = default
504+
505+
route upload_session/append_v2 (UploadSessionAppendArg, Void, UploadSessionLookupError)
506+
"Append more data to an upload session.
507+
508+
When the parameter close is set, this call will close the session.
509+
510+
A single request should not upload more than 150 MB of file contents."
511+
512+
attrs
513+
host="content"
514+
style="upload"
515+
516+
456517
struct UploadSessionCursor
457518
session_id String
458519
"The upload session ID (returned by :route:`upload_session/start`)."
@@ -465,7 +526,7 @@ struct UploadSessionCursor
465526
session_id = "1234faaf0678bcde"
466527
offset = 0
467528

468-
route upload_session/append (UploadSessionCursor, Void, UploadSessionLookupError)
529+
route upload_session/append (UploadSessionCursor, Void, UploadSessionLookupError) deprecated by upload_session/append_v2
469530
"Append more data to an upload session.
470531

471532
A single request should not upload more than 150 MB of file contents."
@@ -660,7 +721,9 @@ union SearchError
660721
"An unspecified error."
661722

662723
route search (SearchArg, SearchResult, SearchError)
663-
"Searches for files and folders."
724+
"Searches for files and folders.
725+
726+
Note: Recent changes may not immediately be reflected in search results due to a short delay in indexing."
664727

665728
#
666729
# Errors shared by various operations
@@ -961,3 +1024,103 @@ union RestoreError
9611024

9621025
route restore(RestoreArg, FileMetadata, RestoreError)
9631026
"Restore a file to a specific revision"
1027+
1028+
1029+
#
1030+
# Temporary link
1031+
#
1032+
1033+
struct GetTemporaryLinkArg
1034+
path ReadPath
1035+
"The path to the file you want a temporary link to."
1036+
1037+
example default
1038+
path = "/video.mp4"
1039+
1040+
struct GetTemporaryLinkResult
1041+
metadata FileMetadata
1042+
"Metadata of the file."
1043+
link String
1044+
"The temporary link which can be used to stream content the file."
1045+
1046+
example default
1047+
metadata = default
1048+
link = "https://dl.dropboxusercontent.com/apitl/1/YXNkZmFzZGcyMzQyMzI0NjU2NDU2NDU2"
1049+
1050+
union GetTemporaryLinkError
1051+
path LookupError
1052+
1053+
other*
1054+
1055+
route get_temporary_link(GetTemporaryLinkArg, GetTemporaryLinkResult, GetTemporaryLinkError)
1056+
"Get a temporary link to stream content of a file. This link will expire in four hours and
1057+
afterwards you will get 410 Gone. Content-Type of the link is determined automatically by
1058+
the file's mime type."
1059+
1060+
1061+
#
1062+
# Copy reference
1063+
#
1064+
1065+
struct GetCopyReferenceArg
1066+
path ReadPath
1067+
"The path to the file or folder you want to get a copy reference to."
1068+
1069+
example default
1070+
path = "/video.mp4"
1071+
1072+
struct GetCopyReferenceResult
1073+
metadata Metadata
1074+
"Metadata of the file or folder."
1075+
copy_reference String
1076+
"A copy reference to the file or folder."
1077+
expires common.DropboxTimestamp
1078+
"The expiration date of the copy reference. This value is currently set to be
1079+
far enough in the future so that expiration is effectively not an issue."
1080+
1081+
example default
1082+
metadata = default
1083+
copy_reference = "z1X6ATl6aWtzOGq0c3g5Ng"
1084+
expires = "2045-05-12T15:50:38Z"
1085+
1086+
union GetCopyReferenceError
1087+
path LookupError
1088+
other*
1089+
1090+
route copy_reference/get(GetCopyReferenceArg, GetCopyReferenceResult, GetCopyReferenceError)
1091+
"Get a copy reference to a file or folder. This reference string can be used to
1092+
save that file or folder to another user's Dropbox by passing it to
1093+
:route:`copy_reference/save`."
1094+
1095+
struct SaveCopyReferenceArg
1096+
copy_reference String
1097+
"A copy reference returned by :route:`copy_reference/get`."
1098+
1099+
path Path
1100+
"Path in the user's Dropbox that is the destination."
1101+
1102+
example default
1103+
copy_reference = "z1X6ATl6aWtzOGq0c3g5Ng"
1104+
path = "/video.mp4"
1105+
1106+
struct SaveCopyReferenceResult
1107+
metadata Metadata
1108+
"The metadata of the saved file or folder in the user's Dropbox."
1109+
1110+
example default
1111+
metadata = default
1112+
1113+
union SaveCopyReferenceError
1114+
path WriteError
1115+
invalid_copy_reference
1116+
"The copy reference is invalid."
1117+
no_permission
1118+
"The app has no permission to access another user's Dropbox."
1119+
not_found
1120+
"The file referenced by the copy reference cannot be found."
1121+
too_many_files
1122+
"The operation would involve more than 10,000 files and folders."
1123+
other*
1124+
1125+
route copy_reference/save(SaveCopyReferenceArg, SaveCopyReferenceResult, SaveCopyReferenceError)
1126+
"Save a copy reference returned by :route:`copy_reference/get` to the user's Dropbox."

properties.babel

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
namespace properties
2+
"This namespace contains helper entities for property and property/template endpoints."
3+
4+
alias TemplateId = String(min_length=1,pattern="(/|ptid:).*")
5+
6+
struct PropertyGroupTemplate
7+
"Describes property templates that can be filled and associated with a file."
8+
9+
name String
10+
"A display name for the property template. Property template names can
11+
be up to 256 bytes."
12+
description String
13+
"Description for new property template. Property template descriptions
14+
can be up to 1024 bytes."
15+
fields List(PropertyFieldTemplate)
16+
"This is a list of custom properties associated with a property template.
17+
There can be up to 64 properties in a single property template."
18+
19+
example default
20+
name = "Security"
21+
description = "These properties describe how confidential this file is."
22+
fields = [default]
23+
24+
struct PropertyFieldTemplate
25+
"Describe a single property field type which that can be part of a property template."
26+
27+
name String
28+
"This is the name or key of a custom property in a property template.
29+
File property names can be up to 256 bytes."
30+
description String
31+
"This is the description for a custom property in a property template.
32+
File property description can be up to 1024 bytes."
33+
type PropertyType
34+
"This is the data type of the value of this property. This type
35+
will be enforced upon property creation and modifications."
36+
37+
example default
38+
name = "Security Policy"
39+
description = "This is the security policy of the file or folder described.
40+
Policies can be Confidential, Public or Internal."
41+
type = default
42+
43+
union ModifyPropertyTemplateError extends PropertyTemplateError
44+
conflicting_property_names
45+
"A property field name already exists in the template."
46+
too_many_properties
47+
"There are too many properties in the changed template.
48+
The maximum number of properties per template is 32."
49+
too_many_templates
50+
"There are too many templates for the team."
51+
template_attribute_too_large
52+
"The template name, description or field names is too large."
53+
54+
union PropertyTemplateError
55+
template_not_found TemplateId
56+
"Property template does not exist for given identifier."
57+
restricted_content
58+
"You do not have the permissions to modify this property template."
59+
other*
60+
"An unspecified error."
61+
62+
struct PropertyGroup
63+
"Collection of custom properties in filled property templates."
64+
65+
template_id TemplateId
66+
"A unique identifier for a property template type."
67+
fields List(PropertyField)
68+
"This is a list of custom properties associated with a file.
69+
There can be up to 32 properties for a template."
70+
71+
example default
72+
template_id = "ptid:1a5n2i6d3OYEAAAAAAAAAYa"
73+
fields = [default]
74+
75+
struct PropertyField
76+
name String
77+
"This is the name or key of a custom property in a property template.
78+
File property names can be up to 256 bytes."
79+
value String
80+
"Value of a custom property attached to a file. Values can be up to 1024
81+
bytes."
82+
83+
example default
84+
name = "Security Policy"
85+
value = "Confidential"
86+
87+
union PropertyType
88+
"Data type of the given property added. This endpoint is in beta and
89+
only properties of type strings is supported."
90+
91+
string
92+
"The associated property will be of type string. Unicode is supported."
93+
other*
94+
95+
example default
96+
string = null
97+
98+
#
99+
# Shared struct used for /template/list and /template/get
100+
#
101+
102+
struct GetPropertyTemplateArg
103+
template_id TemplateId
104+
"An identifier for property template added by route properties/template/add."
105+
106+
example default
107+
template_id = "ptid:1a5n2i6d3OYEAAAAAAAAAYa"
108+
109+
struct GetPropertyTemplateResult extends PropertyGroupTemplate
110+
"The Property template for the specified template."
111+
112+
example default
113+
name = "Security"
114+
description = "These properties describe how confidential this file is."
115+
fields = [default]
116+
117+
struct ListPropertyTemplateIds
118+
template_ids List(TemplateId)
119+
"List of identifiers for templates added by route properties/template/add."
120+
121+
example default
122+
template_ids = ["ptid:1a5n2i6d3OYEAAAAAAAAAYa"]
123+

0 commit comments

Comments
 (0)