DE | EN

simplex API

simplex API

Introduction

The simplex metadata API is based on the openAPI3.0 standard in compliance with RFC7231

It consists of the herein fully documented API endpoints and can be tried out interactively:

Overview

Endpoint Function Access Response
/login Login  Author API key

30min valid access token &

3day valid refresh token

/refresh_token Refreshing an Access token Bearer token (refresh_token)

30min valid access token &

3day valid refresh token

/api/v1/* Author/Profile/Projects content manipulations Bearer token  
/upload Uploading video- or thumbnail files Bearer token  
/encode Encoding uploaded video files Bearer token  
/feed Read filtered public project(s) metadata  Public JSON
/multichannel Read filtered public channel(s) metadata Public JSON

 

Quickstart

We will assume that you're using the simplex public cloud. Adapt the serverURL for your private or onpremise installation.

1. Login

Use your author or customer credentials to make a first call to the login endpoint that returns a valid access token for all endpoints:

curl -X POST https://media10.simplex.tv/login \
     -H "Accept: application/json" \
     -d "username=yourAuthor" \
     -d "password=yourPassword"

Hint: Use the returned access tokens for authentication in any further calls. You can refresh an access token for longer session: 

curl -X POST https://media10.simplex.tv/refresh_token \
     -H 'Authorization: Bearer YourRefreshToken'

2. Create a project

curl -X POST "https://media10.simplex.tv/api/v1/projects" 
     -H "accept: application/json" \
     -H "authorization: bearer YourAccessToken" \
     -H "Content-Type: application/json" \
     -d "{\"title\":\"string\",\"description\":\"string\",\"state\":\"ONDEMAND\",\"authScheme\":\"NONE\",\"eventDate\":\"2019-10-11T08:59:51.305Z\",\"enabled\":true,\"isPublic\":true,\"publisher\":\"string\",\"details\":\"string\"}"

This call returns a JSON object containing an identifier to the created project. It consists of a customerID, authorID & projectID. Store them for further reference.

3. Upload a video file

For uploading to simplex, a TUS client is required. See chapter Example Code to get you going.

Video files are usually very large, thus resumable uploading is a must feature. TUS allows this by defining package sizes that are subsequently uploaded and will be automatically retried upon failure.

url      = "https://media10.simplex.tv/upload/{}/{}/{}/".format(customer_id, author_id, project_id)
headers  = {'authorization': 'bearer ' + self.token() }
metadata = {"filename": remote_file_name}

As can be seen, the endpoint requires the values for customer_id, author_id and project_id from the last step & a remote filename which will be used on the next step.

4. Encode a videofile

To start encoding a uploaded video, only the projectID & the remote_filename are required:

curl -X GET https://media10.simplex.tv/encode/project_id/remote_filename \
-H "authorization: bearer YourAccessToken"

Congratulations, with these basic steps you should have an uploaded & encoded project ready to be accessed for your viewers under:

https://media10.simplex.tv/content/customer_id/author_id/project_id/

 

Public API Access

You are invited to consult our separate document for the public simplex endpoints.

The two endpoints /feed & /multichannel do not require authentication. They are intended to be accessible from any frontend.

All projects having enabled:true & is_public:true can be requested under those endpoints.

Hint: Channels are collections of video projects.

Receive all projects within a channel

Example #1:
https://media10.simplex.tv/multichannel/2/00/.ofdd/.s10/json
Result: A List of all channels and contained projects in customer with ID 2.

Example #2:
https://media10.simplex.tv/multichannel/2/1112-1164/.ofdd/.s10/json
Result: A List of 10 projects from channel 1112 or channel 1164 ordered by descending from date

Receive a filtered projects list

.fid/.vPID Filter by project ID
Example: https://media10.simplex.tv/feed/2/3945/.fid/.v63946/json

.fstatus/.vSTATUS Filter by project status: PREVIEW, LIVE, POSTLIVE, ONDEMAND
Example: https://media10.simplex.tv/feed/2/3945/.fstate/.vONDEMAND/json

.flanguage/.vLANG Filter projects by language: de, fr, it, en
Example: https://media10.simplex.tv/feed/2/3945/.flanguage/.vde/json

Access static files (e.g project thumbnails)

Posterfame, original size: simvid_1.jpg
Example: https://media10.simplex.tv/content/2/3945/63946/simvid_1.jpg

Posterframe medium: simvid_1_med.jpg
Example: https://media10.simplex.tv/content/2/3945/63946/simvid_1_med.jpg

Posterframe small: simvid_1_sml.jpg
Example: https://media10.simplex.tv/content/2/3945/63946/simvid_1_sml.jpg

 

Example Code

We provide an example python code for your simplex access class here:

simplex_api_example.zip

 

Further readings

TUS Client

Uploading to simplex requires the use of TUS ( https://tus.io/implementations.html ). Clients exist in every mayor programming language. See one possible usage example in our provided python script.

Authentication Workflow (Login)

Authentication Workflow (Refresh)

Upload Workflow

Custom Metadata

If the provided project metadata fields are not sufficient, there exists a "details" metadata field which can be used to store additional key/value or other content.

See this simple example that can be used for editing (or creating) a project on simplex:

detailsJSON = """
    {
        "param1": "value 1",
        "param2": 123,
        "param3": true
    }""".replace('\n',' ').replace('    ','')
simplex.editProject(project_id = 12345, title = 'myProject', details=detailsJSON))

 

 

If you have any further questions, don't hesitate to contact us under support@xtendx.com


Sie konnten nicht finden wonach Sie gesucht haben? Kontaktieren Sie uns.

Unser Team ist von Montag bis Freitag von 9 Uhr bis 17 Uhr für Sie da. Per E-mail erhalten Sie innerhalb von 24 Stunden eine Antwort.

In dringenden Fällen ausserhalb der Bürozeiten wenden Sie sich an den kostenpflichtigen Support:
+41 44 580 97 16

Support per Mail

Support anrufen

Weitere Support-Artikel

Peer-to-Peer (P2P)
01.03.2017


Multicasting
01.03.2017


Caching
26.09.2016


xtendx kontaktieren

Unser Team ist von Montag bis Freitag von 9 Uhr bis 17 Uhr für Sie da. Per E-mail erhalten Sie innerhalb von 24 Stunden eine Antwort.

In dringenden Fällen ausserhalb der Bürozeiten wenden Sie sich an den kostenpflichtigen Support:
+41 44 580 97 16

Ihre Nachricht wurde erfolgreich übermittelt. Vielen Dank!

Ihre Nachricht konnte nicht übermittelt werden. Sind alle mit * markierten Felder ausgefüllt?