These examples must run on a trusted machine with your private key. Never send your key to an unknown online testing site.
List commercials
curl -H 'Authorization: Bearer YOUR_API_KEY' \
'https://mediarazzi.com/api/v1/commercials'
On Windows PowerShell:
$headers = @{ Authorization = 'Bearer YOUR_API_KEY' }
Invoke-RestMethod -Uri 'https://mediarazzi.com/api/v1/commercials' -Headers $headers
Create a commercial from an existing MP4
curl -X POST 'https://mediarazzi.com/api/v1/commercials' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
--data '{"title":"Sponsor intro","mp4_url":"https://example.com/ad.mp4","click_url":"https://example.com/offer","duration_seconds":15,"width":1920,"height":1080,"skip_after_seconds":5}'
Create a pod
curl -X POST 'https://mediarazzi.com/api/v1/pods' \
-H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' \
--data '{"name":"Two-ad pre-roll","mode":"sequence"}'
Replace a pod's playback order
curl -X PUT 'https://mediarazzi.com/api/v1/pods/123/items' \
-H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' \
--data '{"commercial_ids":[12,18]}'
Replace IDs with records belonging to your own account. These examples do not bypass access controls. For a video upload, use POST /commercials/upload with a multipart video file and form fields.