getUrl #
Returns a Presigned URL to upload directly to S3.
The URL expires after a configurable TTL. (Configurable in the kuzzlerc file)
Query Syntax #
HTTP #
URL: http://kuzzle:7512/upload/get-url/<bucketRegion>/<bucketName>/<filename>?uploadDir=<uploadDir>&publicUrl=false
Method: GET
Other protocols #
{
"controller": "s3/upload",
"action": "getUploadUrl",
"bucketName": "bucket-name"
"bucketRegion": "bucket-region"
"filename": "headcrab.png",
"uploadDir": "xen",
"publicUrl" : false
}
Arguments #
filename
: Uploaded file nameuploadDir
: Upload directory (see s3 file key)bucketName
: Name of the bucketbucketRegion
: Region of the bucketpublicUrl
(optionnal): boolean indicating that plugin should return public URL
Response #
Returns an object with the following properties:
fileKey
: file key in S3 bucketuploadUrl
: presigned upload URLttl
: TTL in ms for the URL validity and before the uploaded file deletion
{
"status": 200,
"error": null,
"controller": "s3/upload",
"action": "getUploadUrl",
"requestId": "<unique request identifier>",
"result": {
"fileKey": "xen/<uuid>-headcrab.png",
"uploadUrl": "https://s3.eu-west-3.amazonaws.com/...",
"ttl": 1200000
}
}
Possible errors #
Edit this page on Github(opens new window)