@@ -725,8 +725,7 @@ struct ExportMetadata
725
725
For more information see our :link:`Content hash https://www.dropbox.com/developers/reference/content-hash` page."
726
726
727
727
paper_revision Int64?
728
- # TODO(jessk): after /files/paper/update is made public, add "which can be used in :route:`paper/update`."
729
- "If the file is a Paper doc, this gives the latest doc revision."
728
+ "If the file is a Paper doc, this gives the latest doc revision which can be used in :route:`paper/update`."
730
729
731
730
example default
732
731
name = "Prime_Numbers.xlsx"
@@ -3070,3 +3069,148 @@ route get_file_lock_batch (LockFileBatchArg, LockFileBatchResult, LockFileError)
3070
3069
#
3071
3070
# END OF FILE LOCKING
3072
3071
#
3072
+
3073
+
3074
+ #
3075
+ # Paper routes
3076
+ #
3077
+
3078
+ union ImportFormat
3079
+ "The import format of the incoming Paper doc content."
3080
+
3081
+ html
3082
+ "The provided data is interpreted as standard HTML."
3083
+ markdown
3084
+ "The provided data is interpreted as markdown."
3085
+ plain_text
3086
+ "The provided data is interpreted as plain text."
3087
+
3088
+
3089
+ union PaperContentError
3090
+ insufficient_permissions
3091
+ "Your account does not have permissions to edit Paper docs."
3092
+ content_malformed
3093
+ "The provided content was malformed and cannot be imported to Paper."
3094
+ doc_length_exceeded
3095
+ "The Paper doc would be too large, split the content into multiple docs."
3096
+ image_size_exceeded
3097
+ "The imported document contains an image that is too large. The current limit is 1MB.
3098
+ This only applies to HTML with data URI."
3099
+
3100
+
3101
+ struct PaperCreateArg
3102
+
3103
+ path Path
3104
+ "The fully qualified path to the location in the user's Dropbox where the Paper Doc should be created.
3105
+ This should include the document's title and end with .paper."
3106
+ import_format ImportFormat
3107
+ "The format of the provided data."
3108
+
3109
+ example default
3110
+ path = "/Paper Docs/New Doc.paper"
3111
+ import_format = html
3112
+
3113
+
3114
+ struct PaperCreateResult
3115
+
3116
+ url String
3117
+ "URL to open the Paper Doc."
3118
+ result_path String
3119
+ "The fully qualified path the Paper Doc was actually created at."
3120
+ file_id FileId
3121
+ "The id to use in Dropbox APIs when referencing the Paper Doc."
3122
+ paper_revision Int64
3123
+ "The current doc revision."
3124
+
3125
+ example default
3126
+ url = "https://www.dropbox.com/scl/xxx.paper?dl=0"
3127
+ result_path = "/Paper Docs/New Doc.paper"
3128
+ file_id = "id:a4ayc_80_OEAAAAAAAAAXw"
3129
+ paper_revision = 1
3130
+
3131
+
3132
+ union PaperCreateError extends PaperContentError
3133
+ invalid_path
3134
+ "The file could not be saved to the specified location."
3135
+ email_unverified
3136
+ "The user's email must be verified to create Paper docs."
3137
+ invalid_file_extension
3138
+ "The file path must end in .paper."
3139
+ paper_disabled
3140
+ "Paper is disabled for your team."
3141
+
3142
+ union PaperDocUpdatePolicy
3143
+ update
3144
+ "Sets the doc content to the provided content if the provided paper_revision matches the latest doc revision.
3145
+ Otherwise, returns an error."
3146
+ overwrite
3147
+ "Sets the doc content to the provided content without checking paper_revision."
3148
+ prepend
3149
+ "Adds the provided content to the beginning of the doc without checking paper_revision."
3150
+ append
3151
+ "Adds the provided content to the end of the doc without checking paper_revision."
3152
+
3153
+
3154
+ struct PaperUpdateArg
3155
+
3156
+ path WritePathOrId
3157
+ "Path in the user's Dropbox to update. The path must correspond to a Paper doc or an error will be returned."
3158
+ import_format ImportFormat
3159
+ "The format of the provided data."
3160
+ doc_update_policy PaperDocUpdatePolicy
3161
+ "How the provided content should be applied to the doc."
3162
+ paper_revision Int64?
3163
+ "The latest doc revision. Required when doc_update_policy is update.
3164
+ This value must match the current revision of the doc or error revision_mismatch will be returned."
3165
+
3166
+ example default
3167
+ path = "/Paper Docs/My Doc.paper"
3168
+ import_format = html
3169
+ doc_update_policy = update
3170
+ paper_revision = 123
3171
+
3172
+
3173
+ struct PaperUpdateResult
3174
+
3175
+ paper_revision Int64
3176
+ "The current doc revision."
3177
+
3178
+ example default
3179
+ paper_revision = 124
3180
+
3181
+
3182
+ union PaperUpdateError extends PaperContentError
3183
+ path LookupError
3184
+ revision_mismatch
3185
+ "The provided revision does not match the document head."
3186
+ doc_archived
3187
+ "This operation is not allowed on archived Paper docs."
3188
+ doc_deleted
3189
+ "This operation is not allowed on deleted Paper docs."
3190
+
3191
+
3192
+ route paper/create (PaperCreateArg, PaperCreateResult, PaperCreateError)
3193
+ "
3194
+ Creates a new Paper doc with the provided content.
3195
+ "
3196
+
3197
+ attrs
3198
+ is_preview = true
3199
+ style = "upload"
3200
+ scope = "files.content.write"
3201
+
3202
+
3203
+ route paper/update (PaperUpdateArg, PaperUpdateResult, PaperUpdateError)
3204
+ "
3205
+ Updates an existing Paper doc with the provided content.
3206
+ "
3207
+
3208
+ attrs
3209
+ is_preview = true
3210
+ style = "upload"
3211
+ scope = "files.content.write"
3212
+
3213
+
3214
+ #
3215
+ # End of Paper routes
3216
+ #
0 commit comments