Rooms: AddDocumentToRoom

Adds a document to a room.

The following properties in the request body are required. The folderId property is optional. All other properties are ignored.

  • name
  • base64Contents

If a document with the specified name already exists, a counter is added to the name to make it unique.

For example, to create a document named hello.txt that contains the text hello, world, the body of your request would look like this:

{
  "name": "hello.txt",
  "base64Contents": "aGVsbG8sIHdvcmxkCg=="
}

Request

HTTP request

POST /restapi/v2/accounts/{accountId}/rooms/{roomId}/documents

Parameters

Parameter NameValueDescription
Path Parameters
roomIdinteger

(Required) The id of the room.

accountIdstring

(Required) The globally unique identifier (GUID) for the account.

Request Body

document

Responses

CodeDescriptionReference
201

Document successfully added.

RoomDocument
400

Bad request. See ErrorCode and Message for details

ApiError
401

Not authorized to make this request.

ApiError

SDK Method

Rooms::AddDocumentToRoom

Definitions

ApiError

This object describes errors that occur. It is valid only for responses and ignored in requests.

errorCodestring

The code associated with the error condition.

messagestring

A brief message describing the error condition.

Document

Contains information about a document.

documentIdinteger

The ID of the document.

namestring

The file name associated with the document.

roomIdinteger

The id of the room associated with the document.

ownerIdinteger

The id of the user who owns the document.

sizeinteger

The size of the document in bytes.

folderIdinteger

The id of the folder that holds the document.

createdDatestring

The date and time when the document was created. This is a read-only value that the service assigns.

Example: 2019-11-11T17:15:14.82

isSignedboolean

When set to true, indicates that the document is signed.

base64Contentsstring

The base64-encoded contents of the document. This property is only included in the response when you use the includeContents query parameter and set it to true.

RoomDocument

An individual document in a room.

documentIdinteger

The ID of the document.

namestring

The file name of the document.

Example: Short Sale Supplement to Marketing Agreement.pdf

ownerIdinteger

The id of the user who owns the document.

sizeinteger

The size of the document in bytes.

folderIdinteger

The id of the folder the document is in.

createdDatestring

The UTC date and time that the document was created or uploaded.

Example: 2019-07-25T22:18:56.95Z

isSignedboolean

When set to true, this property indicates that the document is signed.

docuSignFormIdstring

The id of the corresponding DocuSign form.

}} />