This API serves as the central repository for all accessibility Document of the different UEs. The UEs are known in the API as tenants. A user and also a service client may belong to one or more Tenants. To login you can use oauth2 to retrieve a token. To retrieve your Bearer Token via command line use this:
curl -u <clientId>:<client-secret> 'https://api.srgssr.ch/oauth/v1/accesstoken?grant_type=client_credentials'
You will receive a message containing the access token:
{
"expires_in": "2591999",
"access_token": "JNgGT9r5TMijXHZBA5zqHPhLj3wg"
.......
}
Then just set the access_token field as Authorization Header when doing further requests.
The API is structured into 3 Levels.
- Reference Asset - contains the placeholder assets like movie productions that are proxies for the original videos They are referenced by their referenceId that is commonly used within the UEs in Swiss Television environment.
- Attachment - We can add multiple Files to The Reference Asset. Those are called Attachments. An Attachment can be a subtitle file in the most common formats, or an audio description audio file or a video containing SignLanguage. Each Attachment has multiple metadata fields. It has a referenceId, a type (eg. TEXT or VIDEO) a format (eg. SRT, WEBVTT, MP4). A name for the file. And also which ReferenceAsset it belongs to and which Tenant (UE). The upload is possible either via base64 encoded file field or via multipart upload. The json field should only be used for text files. Unless there is a specific reason users should just use the multipart upload (click on content type in the resource to see description) To retrieve the file of an attachment please use the download endpoint. This will return a signed link, valid for a certain period.
- Download - We can retrieve a Download Url from the attachments sub resource.