MyCujoo LiveServices logo
Help centerGetting startedQuick start guidesGetting started with the MCLS API

Home

Welcome

Product & Features

Getting started

Glossary

API Documentation

Getting started with the MCLS API

Our API documentation is available here. To get started with using the MCLS API you first need to generate a token. This can be done using our API: curl 'https://mls-api.mycujoo.tv/auth/v1beta1/login' \ --data-binary '{"org_id":"<orgid>","email":"<your_mcls_email>","password":"<your_mcls_password>"}' The login API call is also described here: https://mcls.mycujoo.tv/api-docs/#authservice_login Once you have the token, you can start making calls to our API. The token that you just requested is valid for 10 years. This token then needs to be sent as a bearer token with every authenticated request: Authorization: Bearer <token>

Example: Create a live stream via the API

To create a live stream we are going to use the following API call: https://mcls.mycujoo.tv/api-docs/index.html#creates-a-new-stream To create the live stream via cURL we would use the following command:

curl -XPOST 'https://mls-api.mycujoo.tv/streaming/v1beta2/streams' \ -H 'Authorization: Bearer <your token>' --data-binary '{"region":"REGION_AUTODETECT","title":"test stream","type":"TYPE_LIVE"}'

This will create a new livestream with a default system configuration. If you wish to create new configurations you can either do that via the API or follow the guide here. The response looks like this:

{ "id": "<random identifier>", "title": "test stream", "config_id": "ckc4qjqwg00000193aia473o8", "type": "TYPE_LIVE", "region": "REGION_AUTODETECT", "key": "<secret>", "endpoint": "rtmp://mls.mycujoo.stream/live", "pull_endpoints": [ { "protocol": "PROTOCOL_HTTP_FLV", "endpoint": "https://flv-pull-mls.mycujoo.stream/xxxx/xxxx/transcoding", "is_transcoded": true } ], "push_endpoints": [ ], "playlists": [ ], "upload_id": "", "external_video_source": "", "is_active": false, "is_enabled": true, "is_public": false, "connection_time_seconds": 0, "transcoding_time_seconds": 0, "transcoding_state": "STATE_UNSPECIFIED", "stats": null, "config": { <config used for this stream> }, "incoming_feed_flv": "" }

Certain fields such as playlists are empty because you aren't sending a signal yet. After a signal has been sent to the endpoint and streamkey given in the response, you'll be able to retrieve the playlists by issuing a GET request using the ID field from the response body:

curl -XGET \ --url https://mls-api.mycujoo.tv/streaming/v1beta2/streams/<random identifier> \ --header 'Authorization: Bearer <your token>'

When the stream is active the playlists will be populated:

{ "id": "<random identifier>", "title": "test stream", "config_id": "ckc4qjqwg00000193aia473o8", "type": "TYPE_LIVE", "region": "REGION_EUROPE_WEST", "key": "<secret>", "endpoint": "rtmp://mls-europe-west.mycujoo.stream/live", "pull_endpoints": [ { "protocol": "PROTOCOL_HTTP_FLV", "endpoint": "https://flv-pull-mls.mycujoo.stream/<secret>/<random identifier>/transcoding", "is_transcoded": true } ], "push_endpoints": [], "playlists": [ { "id": "<random identifier>", "protocol": "PROTOCOL_HLS", "type": "TYPE_CDN", "url": "https://europe-west-hls.mls.mycujoo.tv/<your org>/<random identifier>/master.m3u8", "is_enabled": true, "is_vod": false, "is_transcoded": true, "is_updating": true }, { "id": "<random identifier>", "protocol": "PROTOCOL_HLS", "type": "TYPE_CDN", "url": "https://europe-west-hls-raw.mls.mycujoo.tv/<your org>/<random identifier>/index.m3u8", "is_enabled": true, "is_vod": false, "is_transcoded": false, "is_updating": true } ], "upload_id": "", "external_video_source": "", "is_active": true, "is_enabled": true, "is_public": false, "connection_time_seconds": 21, "transcoding_time_seconds": 16, "transcoding_state": "STATE_ACTIVE", "stats": { "connection_count": 1, "video_resolution": 1080, "video_bit_rate": 1033, "audio_bit_rate": 276, "video_frame_rate": 32, "video_key_frame_interval": 1, "video_key_frame_consistent": true }, "config": { <config used for this stream> }, "incoming_feed_flv": "https://flv-pull-mls.mycujoo.stream/xxxx/transcoding" }

The body of the response is fully described here.