Example requests - Python

See the below 2 examples on how to use the Brid backend API using Python without implementing our SDK.

GET request example

import http.client
import mimetypes
conn = http.client.HTTPSConnection("api.brid.tv")
payload = ''
headers = {
  'Authorization': 'Bearer <YOUR_API_TOKEN>',
  'User-Agent': 'Api | BridVideo',
  'X-Site': '<YOUR_DOMAIN>'
}
conn.request("GET", "/apiv2/players/list/<SITE_ID>/PAGINATION.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

POST request example

import http.client
import mimetypes
conn = http.client.HTTPSConnection("api.brid.tv")
payload = 'partner_id=<SITE_ID>&name=Postman&channel_id=<CHANNEL_ID>&mp4=<URL_TO_MP4_FILE>'
headers = {
  'Authorization': 'Bearer <YOUR_API_TOKEN>',
  'User-Agent': 'Api | BridVideo',
  'X-Site': '<YOUR_DOMAIN>',
  'Content-Type': 'application/x-www-form-urlencoded'
}
conn.request("POST", "/apiv2/videos/add/.json", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))