State API
Brainsonic Live is relying on an in-house application called Event Engine. For each digital event, an Event Engine instance is created.
This API allows third party applications to get information about an Event Engine instance configuration and state.
We assume that this third party application is splited into a frontend application that is executed on client environment and a backend application that runs on a server.
This information is provided thanks to two requests :
getStateURLintends to be requested from a backend application. This returns the endpoint URL that frontend application will need to request.getStateallows the frontend application to request Event Engine instance state every 5s.

- The frontend application get the State URL from the backend application
- The backend application get the Event Engine instance state URL
- Carries a bearer token. JWT HS256 format,
- The token is signed with a secret (API key)
- Contains an API access ID (
aud) and an expiration date (exp) - TTL range = 30s - 60s
- To be cached on backend for 15 minutes
- Every 5 seconds, the frontend application pull the Event Engine instance state
- Response is cached for 5 seconds
Exemple use case
ClientFrontend application request the State URL to backend application (request 1)- If the backend application obtained the State URL more than 15 minutes ago then it need to be requested again (request 2).
There is no need to maintain a state on the backend server. A 15 minutes cache on request 1 is enough. L'Frontend applicationclienteusesdemandethesaStateconfigurationURLcontenanttol'url de requêtage d'état (requête 1)Si le le serveur d'application a récupéré l'url de requêtage du service d'étatil y a plus de 15min alors il la récupère à nouveau (requête 2). Il n'est pas nécessaire de maintenir un état sur le serveur pour cela. Une valeur de cache de ~15min dans la réponse à (requete 1) suffit.L'application utilise l'url d'APIpull Event Engine instance state and configuration every 5 seconds (requêterequest 3)pour récupérer l'état du site en pull période >= 5sL'Frontend applicationclienterequestsredemandeal'urlnewdeStaterequêtageURLd'étatto(requêtethe1)backendtouteapplicationlesevery~15min15 minutes.
get State API URL
propriétés
Success de la réponse en cas de succès response
stateUrl {string}urlURLduthatserviceneedd'étattoàbeappelerrequestedenbyGETfrontend application
requete Method GET
requete Header bearer:<JWT>
reponse Cache: no-cache
response StatusStatuses
- Success 200
ErreurUnauthorized Status 401autre erreurError Status 400
Properties
LeThe token portécarried parby lathe requêterequest estis una Json Web Token encodé(JWT) avecencrypted unwith secreta partagéshared entresecret. Secret is shared between Event Engine etand lethe serveurthird departy l'backend application
- alg: HS256
- aud: <your site/application name>
- exp:
3030souor 60s
get Sate API
propriétés
Success de la réponse en cas de succèsresponse
- playerState
stringprelive|live1|live2|postlive|vod - playerManifest
stringurl du hls - countdown
objectpropriétés du countdown- visible
booleantruedécompte visible oufalsedécompte caché - end
unix timestampdate de fin du décompte - serverTime
unix timestamptemps actuel du serveur
- visible
requete Method GET
response Cache 5s
response Status
Response statuses
- Success 200
ErreurUnauthorized Status 401autre erreurError Status 400
Limitations
get State API URL
fréquenceHit/smaximum= 1appel par secondequotaHit/minute = 4appels maximum par minute