Sigma API developers
Last updated
Authorization: Basic Base64Encode(<Username>:<Secret Key>)curl --location 'https://api.sigma.video/api/livestream/channels' \
--header 'X-App-Id: <app_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <token>' \
--data '{
"name": "<channel_name>",
"description": null,
"tags": [],
"transcodeProfile": [
"fbffbd08-ed7f-4a51-aabd-3132ac863bb5",
"54a3d4db-a827-45ae-b6be-1faa21c2e7c6",
"33a26869-0a1b-49a4-8303-1284ac8fd034"
],
"type": "transcode",
"mode": "ultra-low-latency",
"stopTimeout": 30,
"catchup": true,
"record": false,
"outputFormat": "hls",
"machine": {
"enabled": true,
"machineId": "94e98078-b9cb-4d44-b16e-369fdb81da35",
"machineType": "SIGMA_MACHINE"
},
"destinationCatchup": {
"type": "s3",
"s3": {
"accessKey": "<s3_access_key>",
"bucket": "<bucket_name>",
"endpoint": "<s3_end_point>",
"secretKey": "<s3_secrect_key>",
"region": "<s3_region>",
"segmentPrefix": null
}
}
}'
{
"id": "42efeee4-e94e-4444-b0a6-90850413519d",
"name": "Channel_02",
"description": null,
…
}
curl --location 'https://api.sigma.video/api/livestream/channels/<channel_id>' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'{
"id": "42efeee4-e94e-4444-b0a6-90850413519d",
"name": "Channel_02",
"description": null,
"tags": [],
"appId": "0c787e24-87a3-47da-a131-e8310f35aff7",
"inputId": "e5418288-37be-4d0f-8221-f0c5e99efe5b",
"transcodeProfile": […],
"type": "transcode",
"mode": "ultra-low-latency",
"stopTimeout": 30,
"catchup": true,
"destinationCatchup": {
"type": "s3",
"s3": { … }
},
"record": false,
"outputFormat": "hls",
"status": "active",
"machine": { … },
"createdAt": "2024-07-22T10:34:36.772Z",
"updatedAt": "2024-07-23T06:15:31.729Z",
"currentSessionId": "977cc345-d771-4223-9306-07c2b9d49a34",
"input": {
"streamToken":"42efe-a050270cbbab47cbfacd-3519d",
"rtmpServer":"rtmp://103.245.251.51:1935/livestream"
},
"liveStreamUrl": http://103.245.251.51:8080/manifest/42efeee4-e94e-4444-b0a6-90850413519d/master.m3u8,
} curl --location --request PATCH 'https://api.sigma.video/api/livestream/channels/<channel_id>/start' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'curl --location --request DELETE 'https://api.sigma.video/api/livestream/channels/<channel_id>/stop' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'curl --location 'https://api.sigma.video/api/livestream/sessions?q={"channelId":"<channel_id>"}&sort=updatedAt|desc&page=1&perPage=100' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'
curl --location 'https://api.sigma.video/api/livestream/sessions?q={"channelId":"<channel_id>"}&sort=updatedAt|desc&page=1&perPage=100' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'
{
"data": [
{
"name": "Channel_02_2024-07-22-11:33:50",
"status": "ended",
"appId": "0c787e24-87a3-47da-a131-e8310f35aff7",
"recordUrls": [],
"clientInfo": {
"action": "on_publish",
"stream": "42efe-a050270cbbab47cbfacd-3519d",
"ip": "103.245.252.19",
"client_id": "y1799srf",
"param": "",
"tcUrl": "rtmp://103.245.251.51:1935/livestream",
"ips": [],
"app": "livestream",
"stream_id": "vid-4024822"
},
"duration": 40,
"isCreateTask": true,
"channelId": "42efeee4-e94e-4444-b0a6-90850413519d",
"channel": {
"id": "42efeee4-e94e-4444-b0a6-90850413519d",
"name": "Channel_02",
...
},
"id": "5017085c-d828-491d-837f-2160df3e07c1",
"events": [],
"createdAt": "2024-07-22T11:33:50.903Z",
"updatedAt": "2024-07-22T11:35:02.898Z",
"startedAt": "2024-07-22T11:34:20.064Z",
"finishedAt": "2024-07-22T11:35:02.898Z"
},
{
"name": "Channel_02_2024-07-22-11:32:35",
"status": "ended",
"appId": "0c787e24-87a3-47da-a131-e8310f35aff7",
"recordUrls": [],
"clientInfo": {
"action": "on_publish",
"stream": "42efe-a050270cbbab47cbfacd-3519d",
"ip": "103.245.252.19",
"client_id": "ii05j356",
"param": "",
"tcUrl": "rtmp://103.245.251.51:1935/livestream",
"ips": [],
"app": "livestream",
"stream_id": "vid-2wx9608"
},
"duration": 10,
"isCreateTask": true,
"channelId": "42efeee4-e94e-4444-b0a6-90850413519d",
"channel": {
"id": "42efeee4-e94e-4444-b0a6-90850413519d",
"name": "Channel_02"
...
},
"events": [],
"createdAt": "2024-07-22T11:32:35.675Z",
"updatedAt": "2024-07-22T11:33:19.362Z",
"startedAt": "2024-07-22T11:33:05.117Z",
"finishedAt": "2024-07-22T11:33:19.362Z"
}
],
"total": 2,
"count": 2,
"page": 1,
"perPage": 100
}
curl --location 'https://api.sigma.video/api/livestream/sessions/<session_id>/status' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'{"status":"live"}curl --location 'https://api.sigma.video/api/livestream/events?q={"$and":[{"sessionId":"<session_id>"}]}&sort=updatedAt|desc&page=1&perPage=100' \
--header 'X-App-Id: <app_id>' \
--header 'Authorization: Basic <token>'
{
"data": [
{
"actor": "user",
"action": "ended",
"sessionId": "5017085c-d828-491d-837f-2160df3e07c1",
"id": "3b393448-65a8-4258-a418-2bfaa8cda40d",
"createdAt": "2024-07-22T11:35:02.901Z",
"updatedAt": "2024-07-22T11:35:02.901Z",
"message": "Kênh đã kết thúc"
},
{
"action": "stable",
"sessionId": "5017085c-d828-491d-837f-2160df3e07c1",
"id": "66df86b4-c0ed-4db7-868c-a12ca1830c58",
"createdAt": "2024-07-22T11:34:20.063Z",
"updatedAt": "2024-07-22T11:34:20.063Z",
"message": "Kênh ổn định"
}
]
}