Sending a File with Email

You can use the sendFile call to send an email with the file as an attachment.

Sample URL

https://hostname:port/context/rest/v2/documents/sendFile/{id}

Method

POST

Parameters

Parameter Description
id Required.

The document ID.

It can be on the URL, or be posted as a parameter.

recipient Required.

One or more recipients.

The format is <type>:<emailOrUserId>. The valid types are To, CC, and BCC. emailOrUserId is either a valid email address or a user ID.

subject Optional.

Email subject.

The default value is a system generated subject.

message Optional.

A message in HTML format.

The default value is a system generated message.

expirationDate Optional.

The maximum expiration date when download expires.

The format is yyyy-mm-dd. The default date is the maximum expiration date.

expireSameDay Optional.

Expire the same day after all files have been downloaded even if it is before the defined expirationDate parameter.

If value is set as Y or y, it indicates as true; otherwise, it is false. The default is false.

notifyMe Optional.

The valid values are true and false. If the value is true , notify the sender via email when files are downloaded. The default value is true .

Response

HTTP Status Code Description
200 OK. If allowed to send to all recipients.
400 Bad Request. If not allowed to send to all recipients.
500 Internal Server error.

The format of the response is "{"message":"<response message>"}"

Example 1:

We have stored your files on our server and sent your recipients an email with instructions for retrieving it. Recipients have until October 16, 2013 to download your files.
Note: Currently such a message is generated by the browser client. It should be generated by the server later.

Example 2:

abc@xyz.com, the recipient does not exist in the database. You are not authorize to create the account.