Proxy File Upload
Proxy File Upload - kintone.proxy.upload()
Uploads a file to outside of Kintone.
Function
kintone.proxy.upload(url, method, headers, data, successCallback, failureCallback)
Parameters
PARAMETER | VALUE | REQUIRED | DESCRIPTION |
---|---|---|---|
url | String | Yes | The request URL. |
method | String | Yes | The HTTP method. Specify one of the following: POST / PUT . |
headers | Object | Yes | Specify the request header as an object. To ignore this parameter, input {} .Sample: { 'Content-Type': 'application/json' } |
data | Object or String | Yes | The data that will be sent in the request body. |
data.format | String | Yes | Format to be uploaded to the external service. Only the string RAW can be specified. |
data.value | Blob type (including File type) | Yes | Data to be uploaded. The maximum size is 200MB. |
successCallback | Function | Optional | The callback function that will run when the request to the external service has finished. It will receive the response body (string), the status code (number) and the response header (object) as parameters from the external service. If this parameter is ignored, a kintone.Promise object will be returned that can be fulfilled with an array containing a Response body (string), Status code (number) and Response header (object). |
failureCallback | Function | Optional | The callback function that will run when the API request to the external service fails. It will receive the response body (string) as the parameter from the external service. If this parameter is ignored, a kintone.Promise object will be returned that can be rejected with the response body (string) from this API. |
Returns
A kintone.Promise
object will be returned if the successCallback
or failureCallback
parameters are ignored. Otherwise, nothing will be returned.
Sample Request
|
|
Sample Request Using Promises
|
|
Notes
- Specifying a non-existent
url
will return an error status code of503 (DNS Cache Missing)
. - If the request origin subdomain has IP restrictions and attempts to access another App in the same subdomain, the kintone.com IP Addresses must be allowed access. A list of IP Addresses used by Kintone can be found in the following article on the help site:
Domains and IP Addresses Used by Kintone - Note that this allows any kintone.com domain to access the API. Therefore, it is not recommended from a security standpoint.
- When using this API to execute external APIs, cookies that should be generated at the API destination are not automatically generated.
- The
Content-Length
header andTransfer-Encoding
headers are automatically added if the HTTP Method is set toPOST
orPUT
. Explicitly setting when making requests will cause an error. - Any kind of
Content-type
can be used.
Limitations
- The following are the limitations on external API responses to be executed:
- The maximum lines of the response header from the other end of the proxy is 100 lines, and the maximum size for each line is 8,180 bytes.
- The maximum size of the response body from the other end of the proxy is 10MB. Errors will occur if lines or sizes go over the maximum.
- This API can only handle a response body of characters. Images, or other binary data are not supported.
- Communication with servers using self-signed certificates is not possible.
- Compatible browsers can be found on the following link:
Kintone System Requirements