Get file upload URL
GET/api/v1/files/upload_url
Get a signed URLs for uploading local files to Needle.
The upload URLs will be valid for a short time therefore the files should be uploaded immediately after receiving the URL.
Tip: repeat content_type
parameter to generate multiple upload URLs at once.
After upload is complete, your file will be private and protected. Here is how you can upload files using the signed upload URL:
curl -X PUT [upload_url] \
-H "Content-Type: [content_type]" \
--upload-file [path/to/your-file]
If you want to read the files later, you will need to use a signed download URL.
Request
Query Parameters
Possible values: [application/vnd.google-apps.document
, application/vnd.google-apps.presentation
, application/vnd.google-apps.spreadsheet
, application/pdf
, application/vnd.openxmlformats-officedocument.wordprocessingml.document
, application/vnd.openxmlformats-officedocument.presentationml.presentation
, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
, application/msword
, application/vnd.ms-excel
, application/vnd.ms-powerpoint
, text/csv
, text/html
, text/calendar
, text/plain
]
Responses
- 200
- 400
- 401
Successful response
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
result
object[]
required
URLs for uploading files and adding them to collections
File URL that can be used for adding the file to collections
Signed URL to upload the file to
{
"result": [
{
"url": "string",
"upload_url": "string"
}
]
}
Invalid request
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
Human readable error message
Further details on the error
{
"error": {
"message": "string"
}
}
Unauthorized request
- application/json
- Schema
- Example (from schema)
Schema
error
object
required
Human readable error message
Further details on the error
{
"error": {
"message": "string"
}
}