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.

Endpoints

Skip to section
GET/temp-contents/{id}
GET/temp-contents/{id}/details
POST/temp-contents
POST/temp-contents/files
PATCH/temp-contents/files/{id}

Downloads a temporary content file from the service.

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 GET /temp-contents/{id}

Range
optional
string

Set to unit=start-end (for example, bytes=0-100) where unit = bytes (only supported unit), and start/end is a positive integer, where start <= end. Will also handle "start-" and "-end as described in https://tools.ietf.org/html/rfc7233".

Path Parameters GET /temp-contents/{id}

id
string

The temporary contents ID.

Query Parameters GET /temp-contents/{id}

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 GET /temp-contents/{id}

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>"

Retrieves temporary content details from the service.

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 GET /temp-contents/{id}/details

id
string

The temporary contents ID.

Responses GET /temp-contents/{id}/details

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 GET /temp-contents/{id}/details

{
  "ID": "string",
  "Name": "string",
  "CreatedAt": "string",
  "UpdatedAt": "string",
  "CreatorID": "string",
  "TTLSeconds": 0,
  "Expires": "string",
  "Size": "string"
}

Uploads a temporary content file to the service.

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 POST /temp-contents

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 POST /temp-contents

application/octet-stream
string<binary>

The file content (binary) to upload.

Responses POST /temp-contents

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"

Creates a new upload resource (tus protocol `creation` extension POST request).

Request used to create a new upload resource. See tus.io for details.

Header Parameters POST /temp-contents/files

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.

  • filename - the name of the file.
  • ttl - 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. The time defaults to one hour (3600) if not provided. The maximum value is 259200 (3 days).'

Responses POST /temp-contents/files

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>"

Applies the bytes contained in the message at a given offset (tus protocol PATCH request).

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 PATCH /temp-contents/files/{id}

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-Type header.

Content-Length
optional
integer<int64>

Standard HTTP Content-Length header.

Path Parameters PATCH /temp-contents/files/{id}

id
string

The ID used to uniquely identify the upload.

Request Body PATCH /temp-contents/files/{id}

application/offset+octet-stream
string<binary>

The patch content (binary, either a complete or a partial file) to upload.

Responses PATCH /temp-contents/files/{id}

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

object

Properties

message
string

It should return OK.

Errors

An array of Error objects.

Properties

errors

No description

traceId
string

A way to trace the source of the error.

Error

object

An 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

object

Properties

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

string

Standard HTTP Accept-Ranges header.

Location

string

Standard 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

string

Standard HTTP Range header.

CacheControl

string

Standard HTTP Cache-Control header.

ContentType

string

Standard HTTP Content-Type header.

ContentDisposition

string

Standard HTTP Content-Disposition header.

ContentLength

integer

Standard HTTP Content-Length header.

ContentRange

string

Standard HTTP Content-Range header.

TusVersion

string

A comma-separated list of tus protocol versions supported by the server.

TusResumable

string

The version of the tus protocol used.

TusUploadOffset

integer

The byte offset within the upload.

TusUploadLength

integer

The size of the entire upload in bytes.

TusUploadMetadata

string

One 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 file
  • ttl - 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

string

A comma-separated list of the extensions supported by the server. Currently, the implementation supports the creation extension.

TusMaxSize

integer

The maximum allowed size of an entire upload in bytes.

v1.3.4
Was this page helpful?