Download File
Downloads files from an attachment field in an App.
Method | GET |
---|---|
URL | https://{subdomain}.kintone.com/k/v1/file.json |
Authentication | Password Authentication , API Token Authentication , Session Authentication |
Content-Type | application/json (not needed if specifying the query with a query string) |
Contents
Permissions
- App view permissions for the related App are needed.
- Record view permissions for the related record are needed.
- Field view permissions for the related field are needed.
Request Parameters
The file is downloaded by sending the fileKey of the attachment file. This fileKey will first need to be obtained using one of the following APIs:
Note that this fileKey is different from the fileKey obtained from the response when using the Upload File API.
PARAMETER | VALUE | REQUIRED | DESCRIPTION |
---|---|---|---|
fileKey | String | Yes | The value that is set on the Attachment field in the response data returned when using the Get Record API. |
Sample Request (Query String)
JavaScript
|
|
curl Sample
Use the -o option to save the output into a file.
|
|
Sample Request (JSON)
JavaScript
N/A.
Data cannot be set in the body for GET methods when using XMLHttpRequest (XHR). For more information, refer to the following document in the MDN Web Docs:
XMLHttpRequest
curl Sample
|
|
Sample Response
The MIME media type of the uploaded file will be stated in the Content-Type, and information of the file will be set inside the response body.
Obtaining the fileKey
The fileKey of a file can be found in the response of the following API:
Get Record
Below is a sample response including the fileKey to be used with the Download File API.
|
|
Limitations
This API cannot be called with the following API:
Kintone REST API Request