Newer Version Available

This content describes an older version of this product. View Latest

File Information

Get information about a specified file, including references to external files. Upload a new version of an existing file, including references to external files. Rename a file, move a file to a different folder, and delete a file.

To upload a new version of an existing file, make a POST request. Upload the new version as a binary part in a multipart/form-data request. See Uploading Binary Files. To upload a new file to the Files home, use /connect/files/users/me.

Resource
1/connect/files/fileId
1/connect/communities/communityId/files/fileId
Available since version
36.0
In versions 24.0–35.0, use /chatter/files/fileId and /connect/communities/communityId/chatter/files/fileId, which require Chatter.
Requires Chatter
No
HTTP methods
GET, POST, PATCH, DELETE, or HEAD

POST, PATCH, and DELETE available since version 26.0.

Note

Request body for POST

Uploads to SharePoint 2010 are limited to 3 MB.

Root XML tag
<fileInput>
JSON
1{
2     "desc" : "Employee Survey Results",
3     "title" : "emp_surv_results"
4}
Properties
Name Type Description Required or Optional Available Version
content​ModifiedDate Date File-specific last modified date that can be used to set a client-side modified date. Optional 32.0
desc String Description of the file to be uploaded. Optional 24.0
includeExternal​FilePermissions​Info Boolean Specifies whether to include permission information, such as whether the file is shared and what are the available permission types, for external files.

This property can be used with POST requests to /connect/files/users/userId, but not with POST requests to /connect/files/fileId.

Optional 35.0
isInMyFileSync Boolean true if the file is synced withSalesforce Files Sync; false otherwise. Optional 31.0
isMajorVersion Boolean true if the file is a major version; false if the file is a minor version. Major versions can’t be replaced. Optional 31.0
parentFolderId String ID of the containing folder. Optional 31.0
repository​FileId String ID of the external file.

This property can be used with POST requests to /connect/files/users/userId, but not with POST requests to /connect/files/fileId.

If you specify repositoryFileId, don’t specify repositoryFileUri.

Optional 32.0
repository​FileUri String URI of the external file, such as https://drive.google.com/file/d/​0B7a_ei8brT1TMy1CQ0o5NmZQNEE/view.

This property can be used with POST requests to /connect/files/users/userId, but not with POST requests to /connect/files/fileId.

If you specifyrepositoryFileUri, don’t specify repositoryFileId.

Optional 39.0
repositoryId String ID of the external data source.

This property can be used with POST requests to /connect/files/users/userId, but not with POST requests to /connect/files/fileId.

Required if repositoryFileId is specified. Otherwise, Optional. 32.0
reuseReference Boolean Specifies whether to reuse the latest version of a reference you own to an external file rather than creating a duplicate reference.

This property can be used with POST requests to /connect/files/users/userId, but not with POST requests to /connect/files/fileId.

Optional 36.0
sharingOption String Sharing option of the file. Values are:
  • Allowed—Resharing of the file is allowed.
  • Restricted—Resharing of the file is restricted.
Optional 35.0
title String Title of the file. Optional 24.0
Request parameters for POST

Uploads to SharePoint 2010 are limited to 3 MB.

Name Type Description Available Version
desc String Description of the file to be uploaded. 26.0
isDataSync Boolean Indicates whether an automated client generates the request. 31.0
isInMyFileSync Boolean true if the file is synced withSalesforce Files Sync; false otherwise. 31.0
isMajorVersion Boolean true if the file is a major version; false if the file is a minor version. Major versions can’t be replaced. 31.0
sharingOption String Sharing option of the file. Values are:
  • Allowed—Resharing of the file is allowed.
  • Restricted—Resharing of the file is restricted.
35.0
title String Title of the file. 26.0
Request parameters for GET

Get information about the specified file.

Name Type Description Available Version
versionNumber Integer Specify an existing version number for the file. If not specified, the latest version is returned. 23.0
Request parameters for PATCH

Update the title or sync state of a file or move a file to a different folder.

Name Type Description Available Version
desc String A new description for the file 32.0
title String A new title for the file 26.0
isInMyFileSync Boolean true if the file is synced withSalesforce Files Sync; false otherwise. 31.0
parentFolderId String ID of the containing folder 31.0
sharingOption String Sharing option of the file. Values are:
  • Allowed—Resharing of the file is allowed.
  • Restricted—Resharing of the file is restricted.
35.0
Response body for GET, POST, PATCH, and HEAD
File Detail
Response body for DELETE
Returns a status code of 204.
Example
This PATCH request updates the title of a file:
1/connect/files/069D00000001FHF?title=A+New+Title