Latest version

Apply watermark to file

put
https://api.box.com/2.0
/files/:file_id/watermark

Applies or update a watermark on a file.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
12345

The unique identifier that represents a file.

The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/files/123 the file_id is 123.

Request Body

objectin body

The watermark to imprint on the file

stringin bodyrequired
"default"

The type of watermark to apply.

Currently only supports one option.

Value is always default

Response

application/jsonWatermark

Returns an updated watermark if a watermark already existed on this file.

application/jsonWatermark

Returns a new watermark if no watermark existed on this file yet.

application/jsonClient error

An unexpected client error.

put
Apply watermark to file
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X PUT "https://api.box.com/2.0/files/12345/watermark" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "watermark": {
         "imprint": "default"
       }
     }'
TypeScript Gen
await client.fileWatermarks.updateFileWatermark(file.id, {
  watermark: new UpdateFileWatermarkRequestBodyWatermarkField({
    imprint: 'default' as UpdateFileWatermarkRequestBodyWatermarkImprintField,
  }),
} satisfies UpdateFileWatermarkRequestBody);
Python Gen
client.file_watermarks.update_file_watermark(
    file.id,
    UpdateFileWatermarkWatermark(
        imprint=UpdateFileWatermarkWatermarkImprintField.DEFAULT
    ),
)
.NET Gen
await client.FileWatermarks.UpdateFileWatermarkAsync(fileId: file.Id, requestBody: new UpdateFileWatermarkRequestBody(watermark: new UpdateFileWatermarkRequestBodyWatermarkField(imprint: UpdateFileWatermarkRequestBodyWatermarkImprintField.Default)));
Swift Gen (Beta)
try await client.fileWatermarks.updateFileWatermark(fileId: file.id, requestBody: UpdateFileWatermarkRequestBody(watermark: UpdateFileWatermarkRequestBodyWatermarkField(imprint: UpdateFileWatermarkRequestBodyWatermarkImprintField.default_)))
Java
BoxFile file = new BoxFile(api, id);
file.applyWatermark();
Python
watermark = client.file(file_id='12345').apply_watermark()
print(f'Watermark created at {watermark.created_at} and modified at {watermark.modified_at}')
.NET
BoxWatermark watermark = await client.FilesManager.ApplyWatermarkAsync("11111");
Node
client.files.applyWatermark('11111')
	.then(watermark => {
		/* watermark -> {
			watermark: 
			{ created_at: '2016-10-31T15:33:33-07:00',
				modified_at: '2016-10-31T15:33:33-07:00' } }
		*/
	});

Response Example

{
  "watermark": {
    "created_at": "2012-12-12T10:53:43-08:00",
    "modified_at": "2012-12-12T10:53:43-08:00"
  }
}