Lineup
Upload lineup from Excel
Base model view set providing standardized CRUD operations and error handling.
This view set enforces consistent response formats, error handling patterns, and logging across all API endpoints. Subclasses must override the class variables below.
POST
/
api
/
v1
/
lineup
/
upload
Upload lineup from Excel
curl --request POST \
--url https://api.capedigital.co.ke/content/api/v1/lineup/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form 'channel=<string>' \
--form effective_from=2023-12-25 \
--form effective_to=2023-12-25import requests
url = "https://api.capedigital.co.ke/content/api/v1/lineup/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"channel": "<string>",
"effective_from": "2023-12-25",
"effective_to": "2023-12-25"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('channel', '<string>');
form.append('effective_from', '2023-12-25');
form.append('effective_to', '2023-12-25');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.capedigital.co.ke/content/api/v1/lineup/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.capedigital.co.ke/content/api/v1/lineup/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/content/api/v1/lineup/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.capedigital.co.ke/content/api/v1/lineup/upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/content/api/v1/lineup/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"medium": "TV",
"channel": "TV47",
"month": 5,
"year": 2026,
"title": "TV47 MAY 2026",
"version": 1,
"effective_from": "2026-05-01",
"effective_to": "2026-05-31",
"uploaded_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "John Doe",
"employee_number": "EMP-001"
},
"slot_count": {
"2026-05-01": {
"day": "THU",
"count": 12
}
},
"metadata": {},
"created_at": "2026-05-01T08:00:00Z",
"updated_at": "2026-05-01T08:00:00Z"
}Authorizations
Enter your JWT token in the format: Bearer
Body
multipart/form-dataapplication/x-www-form-urlencoded
Excel file (.xlsx) containing the broadcast lineup.
Broadcast medium: TV, RADIO, or DIGITAL.
TV- TVRADIO- RadioDIGITAL- Digital
Available options:
TV, RADIO, DIGITAL Specific channel name e.g. TV47, RADIO 47, TV47 DIGITAL.
Required string length:
1 - 100Schedule start date (defaults to 1st of the parsed month/year).
Schedule end date (defaults to last day of the parsed month/year).
Response
200 - application/json
TV- TVRADIO- RadioDIGITAL- Digital
Available options:
TV, RADIO, DIGITAL Maximum string length:
100Required range:
0 <= x <= 2147483647Required range:
0 <= x <= 2147483647Maximum string length:
255Show child attributes
Show child attributes
Required range:
0 <= x <= 2147483647⌘I
Upload lineup from Excel
curl --request POST \
--url https://api.capedigital.co.ke/content/api/v1/lineup/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file' \
--form 'channel=<string>' \
--form effective_from=2023-12-25 \
--form effective_to=2023-12-25import requests
url = "https://api.capedigital.co.ke/content/api/v1/lineup/upload"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"channel": "<string>",
"effective_from": "2023-12-25",
"effective_to": "2023-12-25"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('channel', '<string>');
form.append('effective_from', '2023-12-25');
form.append('effective_to', '2023-12-25');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.capedigital.co.ke/content/api/v1/lineup/upload', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.capedigital.co.ke/content/api/v1/lineup/upload",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.capedigital.co.ke/content/api/v1/lineup/upload"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.capedigital.co.ke/content/api/v1/lineup/upload")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.capedigital.co.ke/content/api/v1/lineup/upload")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"channel\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_from\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"effective_to\"\r\n\r\n2023-12-25\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"medium": "TV",
"channel": "TV47",
"month": 5,
"year": 2026,
"title": "TV47 MAY 2026",
"version": 1,
"effective_from": "2026-05-01",
"effective_to": "2026-05-31",
"uploaded_by": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "John Doe",
"employee_number": "EMP-001"
},
"slot_count": {
"2026-05-01": {
"day": "THU",
"count": 12
}
},
"metadata": {},
"created_at": "2026-05-01T08:00:00Z",
"updated_at": "2026-05-01T08:00:00Z"
}