Use this method to get TUS’ session parameters: hostname of the server to upload, secure token.
The general sequence of actions for a direct upload of a video is as follows:
Final endpoint for uploading is constructed using the following template: “https:///upload/”. Also you have to provide token, client_id, video_id as metadata too.
A short javascript example is shown below, based on tus-js-client. Variable “data” below is the result of this API request. Please, note that we support 2.x version only of tus-js-client.
uploads[data.video.id] = new tus.Upload(file, {
endpoint: `https://${data.servers[0].hostname}/upload/`,
metadata: {
filename: data.video.name,
token: data.token,
video_id: data.video.id,
client_id: data.video.client_id
},
onSuccess: function() {
...
}
}
uploads[data.video.id].start();
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Video ID.
IDs of all created videos can be received via Get All Videos request
Successful
An array which contains information about servers you can upload a video to.
Server; type — object.
Server has the following fields:
id; type — integer
Server ID
hostname; type — string
Server hostname
Token
Contains information about the created video. See the full description in the Get video request