Temporary Contents Service API
API of the Temporary Content service. This API provides two endpoint categories located under /temporary-contents
and /temporary-contents/files
, respectively.
The /temporary-contents
endpoint provides a proprietary protocol for uploading and downloading temporary files.
These temporary files are kept at the server for a duration defined by a TTL passed with the upload request. The endpoint
includes limited support for ranged downloads as outlined in https://tools.ietf.org/html/rfc7233
The /temporary-contents/files
endpoint provides an implementation of the tus protocol.
tus is an open-source protocol for handling resumable uploads on top of HTTP. This tus implementation supports the
core protocol together with the creation
extension.
Note that completed file uploads through tus, shall be retrieved through the proprietary protocol. The file is
uniquely identified by its ID and can be used on the GET temporary-contents/{id}
and
/v1/temp-contents/{id}/details
endpoints.
This endpoint is used to retrieve a temporary content file from the service. It returns a valid (200 OK
) in case the file exists and the user is authorized to view the contents. It returns a 410 Gone
if the file has expired and 404 Not Found
if the criteria is not met.
Header Parameters
Range optional string | Set to |
Path Parameters
id string | The temporary contents ID. |
Query Parameters
inline optional string | Set to "1" to download the file in inline mode. Useful for displaying a preview of the file in a browser. |
Responses
200 */* object | Success |
204 object | No Content, resource is incomplete. |
206 */* object | Success |
400 application/json | Bad Request |
404 application/json | Not Found |
410 application/json | Gone |
416 application/json | Range Not Satisfiable. |
GET
/temp-contents/{id}
curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents/{id}" \
-H "Authorization: Bearer <API-key>"
This endpoint is used to retrieve a summary of the metadata associated with a temporary content resource. It returns a 200 OK
with a model if the temporary resource is valid. It returns a 410 Gone
if the file has expired and 404 Not Found
if the criteria is not met.
Path Parameters
id string | The temporary contents ID. |
Responses
200 application/json | Success |
204 object | No Content, resource is incomplete. |
400 application/json | Bad Request |
404 application/json | Not Found |
410 application/json | Gone |
GET
/temp-contents/{id}/details
curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents/{id}/details" \
-H "Authorization: Bearer <API-key>"
Response
{
"ID": "string",
"Name": "string",
"CreatedAt": "string",
"UpdatedAt": "string",
"CreatorID": "string",
"TTLSeconds": 0,
"Expires": "string",
"Size": "string"
}
This endpoint is used to upload a file to the service as a temporary content resource. It returns a 201 Created
with a location header that contains the location of the created resource. If filename or TTL is not properly set, a 400 Bad request
is returned. For internal issues, a 500 Internal Server Error
is returned.
Query Parameters
ttl minimum=1, maximum=259200 integer | The TTL parameter is used to define the time-to-live for the content resource in seconds. It defaults to one hour (3600) if no input is provided. Max TTL is 259200 (3 days).' |
filename string | The name of the file to upload. |
Request Body
application/octet-stream string<binary> | The file content (binary) to upload. |
Responses
201 object | Created |
400 application/json | Bad Request. |
POST
/temp-contents
curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents" \
-X POST \
-H "Authorization: Bearer <API-key>" \
-H "Content-type: application/octet-stream" \
--data-binary "@/path/to/file"
Request used to create a new upload resource. See tus.io for details.
Header Parameters
Tus-Resumable string | The version of the tus protocol used. |
Upload-Length integer<int64> | The size of the entire upload in bytes. |
Upload-Metadata string | One or more comma-separated key-value pairs. The key and value must be separated by a space. The key should be ASCII encoded, and the value must be Base64 encoded. All keys must be unique. See tus.io for details. The following keys are used by the Temporary Contents service; any other keys are ignored.
|
Responses
201 object | Created |
400 application/json | Bad Request |
412 application/json | Precondition Failed. tus protocol version not supported by the server. |
413 application/json | Request Entity Too Large |
POST
/temp-contents/files
curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents/files" \
-X POST \
-H "Authorization: Bearer <API-key>"
Request used to apply the bytes contained in the message at a given offset. Note that the tus server only accepts that the Content-Type response header is set to "application/offset+octet-stream". See tus.io for details.
Note that the server may return 423 Locked
on this request. This happens if the client attempts to perform
concurrent access to the resource, for example, if attempting to do a HEAD
request during an ongoing PATCH
request.
It can also occur in situations where the connection is unexpectedly dropped between the client and the server
and the client attempts to make a new request when the server is still busy processing the upload. When this
happens, the client shall, after some period of time, try to resume the upload again.
Header Parameters
Tus-Resumable string | The version of the tus protocol used. |
Upload-Offset integer<int64> | The byte offset within the upload. |
Content-Type string | Standard HTTP |
Content-Length optional integer<int64> | Standard HTTP |
Path Parameters
id string | The ID used to uniquely identify the upload. |
Request Body
application/offset+octet-stream string<binary> | The patch content (binary, either a complete or a partial file) to upload. |
Responses
204 object | No Content. Patch successfully applied to upload. |
400 application/json | Bad Request |
404 application/json | Not Found. Non-existent upload resource. |
409 application/json | Conflict. Upload offsets do not match. |
410 application/json | Gone. The upload resource no longer exists (could have expired). |
412 application/json | Precondition Failed. tus protocol version not supported by the server. |
415 application/json | Unsupported Media Type |
423 application/json | Locked. Concurrent access is not allowed. |
PATCH
/temp-contents/files/{id}
curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents/files/{id}" \
-X PATCH \
-H "Authorization: Bearer <API-key>" \
-H "Content-type: application/offset+octet-stream" \
-d 'undefined'
healthResponse
objectProperties
message string | It should return OK. |
An array of Error objects.
Properties
errors | No description |
traceId string | A way to trace the source of the error. |
Error
objectAn Error object.
Properties
code string | The API error code. |
title string | Title of the type of API Error. |
detail optional string | A human-readable problem description of the issue. |
meta optional | Additional properties and information regarding the issue. |
detailResponse
objectProperties
ID string | Identifier |
Name string | File name of the file uploaded by the user. |
CreatedAt string | Datetime-stamp when the resource was created (in UTC). |
UpdatedAt string | Datetime-stamp when the resource was updated (in UTC). |
CreatorID string | Identifier for the subject / resource creator. |
TTLSeconds integer | Time-to-live in seconds. |
Expires string | Datetime-stamp when the resource expired (in UTC). |
Size string | Size of resource (in bytes). |
AcceptRanges
stringStandard HTTP Accept-Ranges
header.
Location
stringStandard HTTP Location
header.
When used with tus POST (creation
) requests, the server uses this to indicate location at which you can
do HEAD and PATCH requests.
Range
stringStandard HTTP Range
header.
CacheControl
stringStandard HTTP Cache-Control
header.
ContentType
stringStandard HTTP Content-Type
header.
ContentDisposition
stringStandard HTTP Content-Disposition
header.
ContentLength
integerStandard HTTP Content-Length
header.
ContentRange
stringStandard HTTP Content-Range
header.
TusVersion
stringA comma-separated list of tus protocol versions supported by the server.
TusResumable
stringThe version of the tus protocol used.
TusUploadOffset
integerThe byte offset within the upload.
TusUploadLength
integerThe size of the entire upload in bytes.
TusUploadMetadata
stringOne or more comma-separated key-value pairs. The key and value must be separated by space. The key should be ASCII encoded, and the value must be Base64 encoded. All keys must be unique. See tus.io for details.
The following keys are used by the Temporary Contents service, any other keys are ignored
filename
- the name of the filettl
- the time-to-live for the uploaded file in seconds. Note that the time is counted from the start of the upload creation, not when the upload has finished. The server will keep the file available for access for this period of time. The server may then delete it. It defaults to one hour (3600) if not provided. The maximum value is 259200 (3 days).'
TusExtension
stringA comma-separated list of the extensions supported by the server.
Currently, the implementation supports the creation
extension.
TusMaxSize
integerThe maximum allowed size of an entire upload in bytes.