File upload endpoint
Description
Endpoint provides a functionality to upload multiple client files direct to Palabra cloud.
Files submission occurs in several requests:
- Client sends a POST request to the endpoint with a list of files to upload. Server verify the request and generates a pre-signed URL for each submitted file.
- Client sends a POST request to each pre-signed URL with the file to upload.
Limitations
A client is allowed to upload up to 10
files at a time.
Each file must be greater than 0.1 MB
and less than 10 MB
in size. Reach out to the support team
if you need to upload larger files.
Following MIME types are granted:
audio/mpeg
audio/aac
audio/wav
audio/webm
audio/mp3
video/webm
video/mp4
video/mpeg
Examples
cURL
1. Submitting a list of files to receive pre-signed URLs for each file.
curl -X 'POST' \
'https://api.palabra.ai/saas/upload' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <JWT_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"data": [
{
"filename": "A7 E.bf7FPG_6bvIa9cDodiL41RtSZ_",
"mime_type": "audio/x-wav",
"display_name": "string",
"description": "string",
"item_id": "string"
}
]
}'
2. Submitting files
Endpoint respond with a JSON array object containing url
and form_data
keys for each submitted file.
In the following example, we're use cURL command making a POST FormData request to upload a file:
curl -X POST \
-F 'key=bl...0f' \
-F 'x-amz-algorithm=AWS4-HMAC-SHA256' \
... Other form data fields from the response...
-F 'policy=eyJleHBpc...zA3WiJ9XX0=' \
-F 'x-amz-signature=463f78071...847af0c' \
-F file=@<file path at your file system> \
https://url.from.the/response/
References
- Basics: Browser-Based Uploads Using POST
- Example: Browser-Based Upload using HTTP POST
- AWSJavaScriptSDK
Request Body — REQUIRED | |||||
---|---|---|---|---|---|
data object[] — REQUIREDList of blobs to upload
|
Responses | |||||||||
---|---|---|---|---|---|---|---|---|---|
200 Successful Response
| |||||||||
default Default Response
|