Get Media File
curl --request GET \
--url https://api.politicalcomms.com/v1/media/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/media/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.politicalcomms.com/v1/media/{id}', 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.politicalcomms.com/v1/media/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.politicalcomms.com/v1/media/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.politicalcomms.com/v1/media/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/media/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"media_id": "5d2b8f4a-7c31-4e9d-b6a8-3f9c1e5d7a20",
"organization_id": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"brand_id": "7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64",
"name": "rally-photo.jpg",
"status": "ready",
"content_type": "image/jpeg",
"file_size_bytes": 482133,
"storage_key": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10/7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64/rally-photo_image_5d2b8f4a.jpg",
"url": "https://media.politicalcomms.com/0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10/7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64/rally-photo_image_5d2b8f4a.jpg",
"uploaded_via_api": true,
"created_at": "2025-04-02T15:30:00.000Z",
"optimized_at": "2025-04-02T15:30:12.000Z"
}
}Media Files
Get Media File
Fetch a single media file including optimization status and metadata.
GET
/
media
/
{id}
Get Media File
curl --request GET \
--url https://api.politicalcomms.com/v1/media/{id} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.politicalcomms.com/v1/media/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.politicalcomms.com/v1/media/{id}', 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.politicalcomms.com/v1/media/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.politicalcomms.com/v1/media/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.politicalcomms.com/v1/media/{id}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.politicalcomms.com/v1/media/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"media_id": "5d2b8f4a-7c31-4e9d-b6a8-3f9c1e5d7a20",
"organization_id": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10",
"brand_id": "7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64",
"name": "rally-photo.jpg",
"status": "ready",
"content_type": "image/jpeg",
"file_size_bytes": 482133,
"storage_key": "0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10/7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64/rally-photo_image_5d2b8f4a.jpg",
"url": "https://media.politicalcomms.com/0d9f6a2e-1b34-4c8e-9f21-3e7a8b5c4d10/7c1de5f0-9a42-4b6d-8e33-2f5a9c7b1e64/rally-photo_image_5d2b8f4a.jpg",
"uploaded_via_api": true,
"created_at": "2025-04-02T15:30:00.000Z",
"optimized_at": "2025-04-02T15:30:12.000Z"
}
}Authorizations
Authenticate every request by passing your API key in the X-API-Key header. Keys are scoped to your organization hierarchy.
Path Parameters
Resource ID
⌘I
