General Information

Objects
Check Object Info
Generate Hotlink Link

Upload
Upload a File

Remote Upload
Add a Remote Upload
Check a Remote Upload

General Information
our API URLs are in format https://api.rapidvideo.com/v1/ where v1/ is our current version.
All Requests must be made via HTTP GET or POST requests
It requires a API key, which can found in your settings menu in the User Panel.
Response is always in JSON-Format, below is an example:

{
	"status": <status-code>,
	"msg": "<informational message>",
	"result": <result of the request>
}

STATUS CODES
200: Everything is OK. Request succeeded
400: Bad request (e.g. wrong parameters)
403: Permission denied (wrong api login/key, action on a file which does not belong to you, ...)
404: File not found (e.g. deleted video or wrong URL)
451: Unavailable For Legal Reasons (e.g. DMCA takedown, private video, etc) 50x: Server errors. You should not see this, but be prepared.

Check Object Info
check the status of a link/embed, e.g. if the video is online

REQUEST SYNTAX
https://api.rapidvideo.com/v1/objects.php?ac=info&code={object_code}&apikey={your_api_key}

PARAMETERS
Name Description Example Required
code The Object-ID of a video 2OtDWmPw (single) or 2OtDWmPw,ur9v89nX, (seperated by commas) Yes
apikey API-Key 098f6bcd4621d373cade4e832627b4f6 No

EXAMPLE RESPONSE
{
    "status": 200,
    "msg": "OK",
    "result": {
       "3FOYXUJCD": {
            "code": "2OtDWmPw",
            "status": 200,
            "name": "Elysium_trailer_1-4K-HDTN.mp4",
            "description": ""
        }
    }
}


Generate Hotlink Links from a Video (BUSINESS PLAN FEATURE)
This function generates a direct url video location of the video file, where you can use it for your app or website with own player. It returns a JSON array with available formats, a higher codec_id represents a higher quality level.
This API Call has to made on server-side and you must enter the IP adress of the client/vistor on every view, because of the hotlinking protection.

REQUEST SYNTAX
https://api.rapidvideo.com/v1/generate_hotlink.php?apikey={your api key}code={object code}&ip={vistor ip}

PARAMETERS
Name Description Example Required
apikey API-Key 098f6bcd4621d373cade4e832627b4f6 Yes
code The Object-ID of a video 2OtDWmPw Yes
ip The IPv4 or IPv6 from the client/vistor
If the vistor access via IPv6, please use this IPv6 address instead of IPv4
127.0.0.1 Yes

EXAMPLE RESPONSE
[
	{"codec_id":"86","url":"https:\/\/www334.playercdn.net\/86\/1\/Dd-X4KnjSvkVLp89nQFHSA\/1511625802\/170505\/479AOupLlKoP0za.mp4",
	  "title":"video.mp4"},
	{"codec_id":"87","url":"https:\/\/www241.playercdn.net\/87\/1\/6umy9wpA0yJLVUJxLLN5Hw\/1511625802\/170513\/955jk9kgw82HJMr.mp4",
	  "title":"video.mp4"},
	{"codec_id":"85","url":"https:\/\/www334.playercdn.net\/85\/1\/XyXZh8rpT3XPVM21eWW82Q\/1511625802\/170803\/514FI6R76R4G45ZAUOYFJ.mp4",
	  "title":"video.mp4"}
]

Upload a Video
upload a video

REQUEST SYNTAX
https://upload.rapidvideo.com/upload.rapidvideo.com/upload/index.php

PARAMETERS
Name Description Example Standard value Required
user_id Your User-ID (see user settings) 1 - Yes
files[] Array for input files files[0] = contents of first file Yes

EXAMPLE SCRIPT (PHP)
$target_url = 'http://upload.rapidvideo.com/upload.rapidvideo.com/upload/index.php';
//This needs to be the full path to the file you want to send.
$file_name_with_full_path = realpath('./testfile.bin');

if (function_exists('curl_file_create'))
{ // php 5.5+
  $cFile = curl_file_create($file_name_with_full_path);
} else { // 
  $cFile = '@' . realpath($file_name_with_full_path);
}

$post = array('user_id' => '1','files[0]'=> $cFile);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$target_url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result=curl_exec($ch);
curl_close ($ch);

$json = json_decode($result, true);
if($json["files"][0]["url"])
{
	echo $json["files"][0]["url"]."\n";
}

EXAMPLE RESPONSE




Add a Remote Upload
upload a video via Remote Upload System

REQUEST SYNTAX
https://api.rapidvideo.com/v1/remote.php?ac=add&user_id={user_id}&url={url}

PARAMETERS
Name Description Example Standard value Required
user_id Your User-ID (see user settings) 1 - Yes
url URL Source http://download.blender.org/demo/movies/Sintel.2010.1080p.mkv - Yes

EXAMPLE RESPONSE
{
    "status": 200,
    "msg": "OK",
    "result": {
            "id": "123",
            "status": "OK"
    }
}

Check a Remote Upload
check status from Remote Upload System

REQUEST SYNTAX
https://api.rapidvideo.com/v1/remote.php?ac=check&user_id={user_id}&remote_id={remote_id}

PARAMETERS
Name Description Example Standard value Required
user_id Your User-ID (see user settings) 1 - Yes
remote-id Remote-ID from previous response, that you added a link before 1 - Yes

EXAMPLE RESPONSE
{
	"status":"OK",
	"result": {
		"total_filesize":"104857600",
		"transfer_filesize":"104335557",
		"progress":"100",
		"done":"1",
		"object_code":"FFABCDEFGH"
	}
}