Vidoza API

General

Base-URL for our API is https://api.vidoza.net

Requests to the API should be made via HTTP GET or POST parameters. Response is always in JSON-Format.

Authorization requires API key, which you can find in your settings menu in the User Panel. API key should be added in HTTP headers:

Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK

or as GET / POST parameter api_token

HTTP Upload

Request URL

https://api.vidoza.net/v1/upload/http/server

There are 2 stage in upload:

1. You should get an Upload URL via GET request.

Example of request


curl -X GET \
  https://api.vidoza.net/v1/upload/http/server \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response


{
    "data": {
        "upload_url": "https://upload22.vidoza.net/upload/03",
        "upload_params": {
            "is_xhr": true,
            "sess_id": "SDErfNTBc03PYnmw"
        }
    }
}

2. Uploads should be made via POST request to the upload URL returned by our API and it should be multipart/form-data encoded.
Also you should add all parameters (upload_params) received in GET request.

Example of request


curl -X POST \
  https://upload22.vidoza.net/upload/03 \
  -H 'cache-control: no-cache' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F is_xhr=true \
  -F sess_id=SDErfNTBc03PYnmw \
  -F file=@/tmp/video.mp4

Example of response


{
    "status": "OK",
    "code": "zb736dqrhx45"
}

The file will be available by URL https://vidoza.net/zb736dqrhx45.html

Parameters

Required parameters for upload:

  • is_xhr (always “ true”)
  • sess_id
  • file - file for upload

Optional parameters (see https://vidoza.net/?op=upload_multi)

  • file_title
  • file_descr
  • fld_id - folder id
  • cat_id - Video Category. Adult = 2 Not adult = 3
  • extra_Year
  • tags

Example


<?PHP
function vidoza_upload($apiToken, $file, $params  = array())
{
    // Get upload server
    $ch = curl_init('https://api.vidoza.net/v1/upload/http/server');
    $authorization = "Authorization: Bearer ".$apiToken; // Prepare the authorisation token
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization )); // Inject the token into the header
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $res = curl_exec($ch);
    if (curl_getinfo($ch, CURLINFO_HTTP_CODE) != 200) {
        return false;
    }
    curl_close($ch);
    $res = json_decode($res);
    if (!$res->data) {
        return false;
    }

    // POST variables
    $postParams = array();
    foreach (array_merge((array) $res->data->upload_params, $params) as $field => $value) {
        $postParams[$field] = $value;
    }
    if (function_exists('curl_file_create')) { // php 5.5+
        $postParams['file'] = curl_file_create($file);
    } else {
        $postParams['file'] = '@' . realpath($file);
    }

    // Upload file
    $ch = curl_init($res->data->upload_url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postParams);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $postResult = curl_exec($ch);
    if (curl_errno($ch)) {
        print curl_error($ch);
        print "Unable to upload file." . curl_errno($ch);
       return false;
    }
    curl_close($ch);
    $res = json_decode($postResult, true);
    if (($res['status'] != 'OK')) {
        print "Upload error:" . $res['code'];
        return false;
    }
}

$apiToken = 'GIjUt8';
$fileCode = vidoza_upload($apiToken, '/tmp/video.mp4');
print "https://vidoza.net/{$fileCode}.html";

Status of files

You can check whether your file is active or deleted.

Request URL

https://api.vidoza.net/v1/files/check

Files’ codes should be sent via GET array (not more 50 codes) such a way
?f[]=dsx720i6x2zn&f[]=kk2osjr01ogp&f[]=zb736dqrhx45

Example of request


curl -X GET \
  'https://api.vidoza.net/v1/files/check?f[]=dsx720i6x2zn&f[]=kk2osjr01ogp&f[]=zb736dqrhx45' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response


{
    "data": [
        {
            "id": "dsx720i6x2zn",
            "name": "Ariana Grande - God is woman.mp4",
            "title": "Ariana Grande - God is woman",
            "descr": "",
            "folder_id": 0,
            "status": "active",
            "streamable": true
        },
        {
            "id": "kk2osjr01ogp",
            "name": "Naan_Kadavul.avi",
            "title": "Naan Kadavul",
            "descr": "",
            "folder_id": 0,
            "status": "active",
            "streamable": false
        },
        {
            "id": "zb736dqrhx45",
            "name": "Cinema_countdown_timer.mp4",
            "title": "Cinema countdown timer",
            "descr": "",
            "folder_id": 0,
            "status": "deleted",
            "delete_reason": "abuse"
        }
    ]
}

Fields of response

  • Status: “active” / “deleted”
  • Delete_reason: if the file was deleted, you get the reason of deletion
  • Streamable: “true” if the file was already encoded / “false” if the file is in encoding queue

Folder Management

Request URL

https://api.vidoza.net/v1/folders

List Folder

Shows the list of your folders

Example of request


curl -X GET \
  https://api.vidoza.net/v1/folders/ \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'Postman-Token: 5bf18970-4436-42ed-a66c-8746bdebc779' \
  -H 'cache-control: no-cache'

Example of response


{
    "data": [
        {
            "id": 12,
            "name": "TopFolder2",
            "parent_id": 0
        },
        {
            "id": 69,
            "name": "TopFolder1",
            "parent_id": 0
        },
        {
            "id": 42428,
            "name": "torrent",
            "parent_id": 0
        },
        {
            "id": 96087,
            "name": "SecondLevel1",
            "parent_id": 69
        },
        {
            "id": 96088,
            "name": "SecondLevel2",
            "parent_id": 69
        },
        {
            "id": 96089,
            "name": "ThirdLevel1",
            "parent_id": 96087
        }
    ],
    "links": {
        "first": "https://api.vidoza.net/v1/folders?page=1",
        "last": "https://api.vidoza.net/v1/folders?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://api.vidoza.net/v1/folders",
        "per_page": 100,
        "to": 6,
        "total": 6
    }
}

Show the specific folder

Example of request


curl -X GET \
  https://api.vidoza.net/v1/folders/69 \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Example of response


{
    "data": {
        "id": 69,
        "name": "TopFolder1",
        "parent_id": 0,
        "subfolders": [
            96087,
            96088
        ]
    }
}

Fields of response

  • “subfolders” is ID of subfolders

Rename Folder

Example of request


curl -X PUT \
  'https://api.vidoza.net/v1/folders/96088?name=NewName' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Create Folder

Example of request


curl -X POST \
  'https://api.vidoza.net/v1/folders?name=NewFolder&parent_id=69' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer fB5T3IaHjtUXQNb3IH0Lm4epcRHnkAK' \
  -H 'cache-control: no-cache'

Parameters

  • name - Name of folder
  • parent_id - Folder ID ( if 0, new folder will be created in the root folder)
  • Example of response

    
    {
        "data": {
            "id": 96090,
            "name": "NewFolder",
            "parent_id": "69",
            "subfolders": []
        }
    }
    
    We ask that you allow us to use a little bit of your CPU to mine cryptocurrency, this helps us to reduce ads and stay alive.
    If you want you can cancel mining.