Newer Version Available
Users Files, General
Post a file, including references to external files, to
Salesforce Files Sync 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.
- Resource
-
1/chatter/users/userId/files1/connect/communities/communityId/chatter/users/userId/files - Available since version
- 24.0
- Requires Chatter
- Yes
- 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
-
- Request parameters for POST
-
- Request parameters for GET
-
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 from 1 through 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
- This example creates a new file and uploads it to Salesforce Files Sync. The example shows the body parts in a multipart/form-data request.
The first body part is a File Input request body. The second is the
content of the file. For more information, see Uploading Binary Files.
1POST /services/data/v35.0/chatter/users/me/files 2 3Authorization: OAuth 00DD0000000Jhd2!AQIAQC.lh4qTQcBhOPm4TZom5IaOOZLVPVK4wI_rPYJvmE8r2VW8XA. 4OZ7S29JEM_7Ctq1lst2dzoV.owisJc0KacUbDxyae 5User-Agent: Jakarta Commons-HttpClient/3.0.1 6Host: instance_name 7Content-Length: 489 8Content-Type: multipart/form-data; boundary=a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq 9Accept: application/json 10 11--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq 12Content-Type: application/json; charset=UTF-8 13Content-Disposition: form-data; name="json" 14 15{ 16 "title":"BoatPrices" 17} 18 19--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq 20Content-Disposition: form-data; name="fileData"; filename="BoatPrices.txt" 21Content-Type: application/octet-stream; charset=ISO-8859-1 22 23...contents of BoatPrices.txt... 24 25--a7V4kRcFA8E79pivMuV2tukQ85cmNKeoEgJgq--