Upload video

Upload video from your local machine

Upload video using add method

You can upload a video and add some basic metadata for it using the "add" API method.

POST https://api.brid.tv/apiv3/video/add.json

Parameter name

Description

Required

partner_id (integer)

Partner (website) id from Brid CMS

yes

channel_id (integer)

Id of the channel in which the video should belong. See list of default channels

yes

name (string)

Video title

yes

mp4 (string)

Valid URL to the MP4 file

yes

publish (string)

Date in valid format d-m-Y

yes

description (string)

Video description

optional

tags (string)

Comma separate video tags

optional

encode (int)

Encode video or use provided URL as a source (externally host). Default value is false

optional

image (string)

Valid url to img for video snapshot. Should be used only if you want to have custom video snapshot.

optional

copy_snapshot (integer)

Set this to true if image is provided in the request

optional

kill_date (string)

Valid date in format d-m-Y, when video will be unpublished

optional

geo_on (integer)

Set this to true if you want to enable GEO targeting for video. Default value is false

optional

geo (string)

Comma separated value of valid country codes from: https://www.pastiebin.com/5d662fd3ef474

optional

Example request

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://<<brid_api_url>>/apiv3/video/add.json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => array('partner_id' => '{{PARTNER_ID}}','channel_id' => '18','name' => 'Crying Beagle Puppy is Too Small To Jump On Couch','mp4' => 'https://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4','description' => 'Our beagle puppy Lilly is too little to jump on the couch . She crying because she wants to sleep with our baby daughter and steal her food .','publish' => '19-02-2020','tags' => 'cute,dog,puppy','encode' => '1','image' => 'https://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4_thumb','copy_snapshot' => '1','kill_date' => '19-09-2020','geo_on' => '0','geo' => 'AF,AX,DZ'),
  CURLOPT_HTTPHEADER => array(
    "User-Agent: Api | BridVideo"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
  .addFormDataPart("partner_id", "{{PARTNER_ID}}")
  .addFormDataPart("channel_id", "18")
  .addFormDataPart("name", "Crying Beagle Puppy is Too Small To Jump On Couch - prc")
  .addFormDataPart("mp4", "http://cdn.brid.tv/uid/partners/12579/sd/540625.mp4")
  .addFormDataPart("description", "Our beagle puppy Lilly is too little to jump on the couch . She crying because she wants to sleep with our baby daughter and steal her food .")
  .addFormDataPart("publish", "19-02-2020")
  .addFormDataPart("tags", "cute,dog,puppy")
  .addFormDataPart("encode", "1")
  .addFormDataPart("image", "https://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4_thumb")
  .addFormDataPart("copy_snapshot", "1")
  .addFormDataPart("kill_date", "19-09-2020")
  .addFormDataPart("geo_on", "0")
  .addFormDataPart("geo", "AF,AX,DZ")
  .build();
Request request = new Request.Builder()
  .url("https://api.brid.tv/apiv3/video/add.json")
  .method("POST", body)
  .addHeader("User-Agent", "Api | BridVideo")
  .build();
Response response = client.newCall(request).execute();
var https = require('follow-redirects').https;
var fs = require('fs');

var options = {
  'method': 'POST',
  'hostname': 'api.brid.tv',
  'path': '/apiv3/video/add.json',
  'headers': {
    'User-Agent': 'Api | BridVideo'
  },
  'maxRedirects': 20
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"partner_id\"\r\n\r\n{{PARTNER_ID}}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"channel_id\"\r\n\r\n18\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nCrying Beagle Puppy is Too Small To Jump On Couch - prc\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"mp4\"\r\n\r\nhttp://cdn.brid.tv/uid/partners/12579/sd/540625.mp4\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"description\"\r\n\r\nOur beagle puppy Lilly is too little to jump on the couch . She crying because she wants to sleep with our baby daughter and steal her food .\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"publish\"\r\n\r\n19-02-2020\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"tags\"\r\n\r\ncute,dog,puppy\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"encode\"\r\n\r\n1\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"image\"\r\n\r\nhttps://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4_thumb\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"copy_snapshot\"\r\n\r\n1\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"kill_date\"\r\n\r\n19-09-2020\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"geo_on\"\r\n\r\n0\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"geo\"\r\n\r\nAF,AX,DZ\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";

req.setHeader('content-type', 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');

req.write(postData);

req.end();
import http.client
import mimetypes
conn = http.client.HTTPSConnection("api.brid.tv")
dataList = []
boundary = 'wL36Yn8afVp8Ag7AmP8qZ0SA4n1v9T'
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=partner_id;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("{{PARTNER_ID}}")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=channel_id;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("18")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=name;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("Crying Beagle Puppy is Too Small To Jump On Couch - prc")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=mp4;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("http://cdn.brid.tv/uid/partners/12579/sd/540625.mp4")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=description;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("Our beagle puppy Lilly is too little to jump on the couch . She crying because she wants to sleep with our baby daughter and steal her food .")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=publish;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("19-02-2020")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=tags;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("cute,dog,puppy")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=encode;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("1")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=image;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("https://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4_thumb")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=copy_snapshot;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("1")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=kill_date;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("19-09-2020")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=geo_on;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("0")
dataList.append('--' + boundary)
dataList.append('Content-Disposition: form-data; name=geo;')

dataList.append('Content-Type: {}'.format('multipart/form-data'))
dataList.append('')

dataList.append("AF,AX,DZ")
dataList.append('--'+boundary+'--')
dataList.append('')
body = '\r\n'.join(dataList)
payload = body
headers = {
  'User-Agent': 'Api | BridVideo',
  'Content-type': 'multipart/form-data; boundary={}'.format(boundary)
}
conn.request("POST", "/apiv3/video/add.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "net/http"

url = URI("https://api.brid.tv/apiv3/video/add.json")

https = Net::HTTP.new(url.host, url.port);
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request["User-Agent"] = "Api | BridVideo"
form_data = [['partner_id', '{{PARTNER_ID}}'],['channel_id', '18'],['name', 'Crying Beagle Puppy is Too Small To Jump On Couch - prc'],['mp4', 'http://cdn.brid.tv/uid/partners/12579/sd/540625.mp4'],['description', 'Our beagle puppy Lilly is too little to jump on the couch . She crying because she wants to sleep with our baby daughter and steal her food .'],['publish', '19-02-2020'],['tags', 'cute,dog,puppy'],['encode', '1'],['image', 'https://smores-video-storage.s3.amazonaws.com/user_168900%2F1582139560371_video.mp4_thumb'],['copy_snapshot', '1'],['kill_date', '19-09-2020'],['geo_on', '0'],['geo', 'AF,AX,DZ']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body

To get list of available channels check our API reference.


Did this page help you?