Create a session
Endpoint
POST /api/v1/session
| Header | Value |
|---|---|
| X-AppEnvId | Your AppEnv Id |
| Authentication | ApiKey [Your client API key] |
Payload
JSON object with session options.
| Option | Required | Default | Description |
|---|---|---|---|
| participants | false | 1 | Number of possible users joining the stream |
| immediate | false | true | If set to false enables waiting for a session if currently no renderer is available |
Response
Fields of importance
| Field | Description |
|---|---|
| renderer.specs.publicDomainName | Hostname of the streaming instance, used for control connections |
| mainConnection.connectionKey | Connection key for the streaming session, needed when integrating in backend |
Sample response
{
"id": "57b40c9d-aa94-423e-86e6-be51399d9f84",
"type": "session",
"renderer": {
"rendererId": "9ecc0e1d-df2f-4691-a279-fc3c3b798c4b",
"ip": "34.147.105.8",
"specs": {
"rendererControlPath": "ws",
"turnServer": "turns-34-147-105-8.renderer.uc-streaming.com",
"region": "europe-west4-c",
"publicDomainName": "streaming-34-147-105-8.renderer.uc-streaming.com",
"Port": "443",
"useRendererControl": "True",
"appVersion": "1.1.2",
"MachineId": "instance-633cd7ba-0110-4638-aa9c-bc2a7b0499ba"
}
},
"expiration": "2023-02-23T14:00:50.3803441Z",
"mainConnection": {
"connectionKey": "19eb84e6-3e96-4bdb-b65d-55af8c372853"
},
"secondaryConnections": [
{
"connectionKey": "b27a28cd-9aeb-46c1-8a3f-b389d1f2f920",
"connectionCode": 12345
},
{
"connectionKey": "d1557502-9446-430e-9f0b-74c330858d55",
"connectionCode": 54321
},
]
}
Possible Response Codes
| Response Status Code | Description |
|---|---|
| 200 | Session created, response contains session information |
| 401 | Invalid or missing API key |
| 403 | Wrong API key for AppEnv |
| 503 | No session available |