Skip to main content

Overview

Currently, you can do the following operations via API:

  • Storage management,
  • Create a task, search and retrieve information about a task,
  • Retrieve credit and profile information.

Authorization

When you log in, you will see a field where you can create a token. After clicking the "Create" button, the token you see should be sent in every request header. The header you must send:

Key: Authorization
Value: Bearer <your_token>

Tasks Service

Let's analyze the following task service example step by step.

POST https://vimqu.com/api/task
{
"input": {
//...
//...
},
"outputs": [
{
//...
//...
},
{
//...
//...
},
]
}

Each task consists of 1 input and "n" outputs. You can add as many outputs as you want. VimQu downloads the input file, performs the operations you want in the output and uploads it back to where you want. Storage is required for downloading and uploading the file. The storage you want to use must be registered in VimQu.

Input

POST https://vimqu.com/api/task
{
"input": {
"source_type": "url",
"path": "https://<your_video_url>.mp4"
},
"outputs": [
{
//...
},
{
//...
}
]
}
info

Input source_type can be url or storage. If source_type is storage, you should also send the storage_id field. In both cases we will verify the input file. There is a 12 second connection timeout limit. If we can't access the file within 12 seconds, you will get a 422 response code.

Storages

After logging in to your VimQu account, you should go to the "Storages" page from the menu. After adding the storage service (gcs, any S3, ftp/sftp, azure) information you use, you can use the ID information in your requests.

POST https://vimqu.com/api/task
{
"input": {
"source_type": "storage",
"storage_id": "<your_ftp_storage_id>",
"path": "/itx_case_4k.webm"
},
"outputs": [
{
"storage_id": "<your_s3_storage_id>",
"target_path" : "/outputs/hls",
//...
},
{
"storage_id": "<your_azure_storage_id>",
"target_path" : "/outputs/mpeg_dash",
//...
}
]
}

In the example above; VimQu will download itx_case_4k.webm file from your registered ftp address. It will do the operations you requested for the first output and upload it to your S3 account. The file will be uploaded to /outputs/hls directory. For the second output, it will do the operations you want and upload it to your Azure account. The file will be uploaded to /outputs/mpeg_dash directory.

tip

All storage information is encrypted and stored in systems such as vault

Output Types

POST https://vimqu.com/api/task
{
"input": {
"source_type": "storage",
"storage_id": "<your_ftp_storage_id>",
"path": "/itx_case_4k.webm"
},
"outputs": [
{
"storage_id": "<your_s3_storage_id>",
"target_path" : "/outputs/thumbnail",
"type": "thumbnail",
"type_specific_config" : {
//...
}
//...
},
{
"storage_id": "<your_azure_storage_id>",
"target_path" : "/outputs/hls",
"type": "hls",
"type_specific_config" : {
//...
}
//...
}
]
}

There must be a type for each output. These types can be thumbnail, video, hls, mpeg_dash. You should send type_specific_config for each type. For example, for thumbnails, you will send image size information or for hls you will send variant information like 720p, 1080p in type_specific_config.

Reference

Task
Input
FieldRequiredDefaultAvailable ValuesDescription
source_typeYES-url, storagewhere to download the input file
storage_idif storage_type is storage then YES, if storage_type is url NOnullnull or your storage_idYour previously saved storage id
pathYES-valid URL or path to your file (absolute path)You should send valid URL if storage_type is url. If storage_type is storage you can send absolute path to file. Example: /inputs/hls
Output
FieldRequiredDefaultAvailable ValuesDescription
storage_idYES-uuidYour previously saved storage id
reference_idNOnullstring or nullThis field for your usage. You can send any value. This value will be sent to you in notifications
target_pathYES-stringAbsolute path to your output directory
typeYES-thumbnail, video, hls, dashExample: /outputs
type_specific_configYES-type_specific_config objectThere is type_specific_config for each type. In Task Service there is an example for each usage

Common Task Result Object

Every time when you create a task, when you query a single task result, when the task result is sent to you via webhook, you will see the following payload.

Common Task Result Object
{
"data": {
"id": "0aead065-7a32-4907-b908-698d32ec1388",
"created_at": "2022-01-06 10:55:31",
"status": "completed",
"outputs": [
{
"id": "ac8543e4-7535-4552-b803-ff3c5249757a",
"reference_id": "<your_reference_id>",
"storage": {
"id": "edf6f4ef-145a-4c46-bfb9-17aaf76c2160",
"name": "<your_storage_name>",
"driver": "ftp"
},
"target_path": "/outputs/number",
"type": "thumbnail",
"files": [
{
"path": "/outputs/thumbnails/thumb_00001.png",
"uploaded_at": "2022-01-06 01:08:23"
},
{
"path": "/outputs/thumbnails/thumb_00002.png",
"uploaded_at": "2022-01-06 01:08:23"
}
]
}
]
}
}
FieldTypePossible ValuesDescription
iduuid-ID of Task
created_atdatetime-Created time of task. UTC
statusstringactive, processing, completed, canceled, failedIt shows the current status of the task
outputsarray-Requested outputs
outputs.iduuid-ID of output
outputs.reference_idstringanyYour reference_id. You sent it in request body
outputs.storagearray-Storage where the output file is uploaded
outputs.target_patharray-Path to the directory where the output file was uploaded
outputs.typestringthumbnail, hls, dash, videoType of output
outputs.filesarray-Path to the file where the output file was uploaded

Response Codes

The VimQu API can give the following response codes.

Http Status CodeDescription
200OK
201OK, Created
400Bad Request, request body invalid, unable to process
401Unauthenticated, Bearer token is invalid.
402Payment Required
403Unauthorized, your account has been suspended for some reason or your transaction is not allowed. For detailed information, see the message value in the response body
404Endpoint / object not found
422There are incorrect values in the request body. Incorrect values sent in response message
429Too Many Request (Currently 60 requests per minute. If you need a higher limit please contact us )
500Internal Server Error. If this happens, we will check immediately. We monitor unwanted situations

If you have any questions, please share them with us.