Newer Version Available

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

Users Files, General

Post a file or get information about files a user owns. These files don’t include files shared with a user, files a user follows, or general organization files.

When you post a file, it is uploaded to the Files tab as a private file and is available only to the file owner.

To upload a file, you must send it in a multipart/form-data request. You can include the description and title of the file in the multipart/form-data request as a JSON or XML request body. You can also send the information as request parameters. For information about how to create the multipart/form-data message, see Uploading Binary Files.

Be aware that this resource may return a large amount of data and may take a while to process.

Important

Resource
1/chatter/users/me/files/
or
1/chatter/users/userId/files/
Available since version
24.0
HTTP methods
GET, POST, or HEAD
Request body for POST
Describes a new file input. To upload a file, provide the binary file in a multipart/form-data body part where name="fileData". See Uploading Binary Files.
Root XML tag
<fileInput>
JSON
1{ 
2   "desc":"Employee Survey Results",
3   "title":"emp_surv_results"
4}
Properties
Name Type Description Available Version
desc String Description of the file to be uploaded. 24.0
isInMyFileSync Boolean true if the file is included in the user’s Salesforce Files folder, and is synced between that folder and Chatter; false otherwise. 30.0 (pilot only)
parentFolderId String ID of the containing folder. 30.0 (pilot only)
title String Title of the file. 24.0
Request parameters for POST
Name Type Description Since version
desc String Description of the file 24.0
isDataSync Boolean The request is automatically generated by an automated client 30.0 (pilot only)
isInMyFileSync Boolean true if the file is included in the user’s Salesforce Files folder, and is synced between that folder and Chatter; false otherwise. 30.0 (pilot only)
title String Title of the file 24.0
Request parameters for GET or HEAD
Parameter Name Type Description Available Since
page Integer An integer specifying a page of items. The default value is 0, which returns the first page. 24.0
pageSize Integer Specifies the number of items per page. Valid values are between 1 and 100. If you don't specify a size, the default is 25. 24.0
q String A query string to filter the results. The string must contain at least two characters, not including wildcards. For information about wildcards, see Wildcards. 27.0
Response body for GET
File Summary Page
Response body for POST
File Summary
Example POST request
The following are the body parts, including a File Input request body, in a multipart/form-data request. For more information, see Uploading Binary Files.
1--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq
2Content-Type: application/json; charset=UTF-8
3Content-Disposition: form-data; name="json"
4
5{
6   "desc":"A new file",
7   "title":"a_new_file"
8}
9
10--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq
11Content-Disposition: form-data; name="fileData"; filename="foo"
12Content-Type: application/octet-stream; charset=ISO-8859-1
13
14This is the content of the file.
15
16--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq--