File resource

Add file

OVERVIEW

This API method supports creation of a new file given the parent folderid. The parent folderid can be obtained by using the “folders list” API endpoint.

Request

POST       /api/1/files/content

The Media type should be set to multipart/form-data

Query Parameters
 

Parameter Name

Value

Description

parentfolderid

Int

The ID for the folder in question

sourceclient={sourceclient} (optional)

 

string

A name which uniquely identifies each client. This name is used to register the changes made by each client application. When the client calls the changes API to determine the changes on the server, this value helps them to determine if the change belonged to them.  This can help them to filter and ignore their changes.  

 

Form Parameters
 

Parameter Name

Value

Description

filename

String

Name of the newly created file

file

Binary file data

Make sure that the parameter name is called file and the value for it is the file to be uploaded

notification

Int

Optional parameter called "notification" which is used for email "notification" preference.
1 = Respect user preference
2 = Force email notification
3 = Suppress all notifications (Default if this parameter is not supplied)
 

 

The file should be added as multipart form data. Please note that the parameters are case sensitive. 

Below are some optional parameters that can be used to manage a two way sync with an external DMS system like worksite. These parameters are stored with the document itself and can be referenced in get file API call. 

 

Parameter Name

Value

Description

dmsparentfolderid 

string

ID of the parent folder of the document as available in the external DMS system

dmsdatabasename

string

The name of the database from where the document was obtained. This is to store the exact location of the document in the external DMS system

dmsdocid

string

The document id of the document in the external DMS system

dmsversion string the version of the document in the external DMS system
dmseditdate string The date when the document was edited in the DMS system. The format for date is yyyy-MM-dd HH:mm:ss 

Please note that in order to view the DMS version information in the files module of a site, you will need to enable the "Show WS versions/drafts" configuration from the site admin -> files module of a site. 

Response

If successful this method returns the details of file resource in the response body.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<file>
    <fileid>855</fileid>
</file>

 

Parameter Name

Value

Description

fileId

Int

The ID for the newly created file in question

Add file

 

Comments


55 Comments

Last Updated: Jun 09,2023