diff --git a/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx b/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx index 42707a86..fe9c3348 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx @@ -26,8 +26,7 @@ call.start_hls_broadcasting() ```bash curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/start_broadcasting?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" ``` diff --git a/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx b/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx index 873dc246..ceb36ee6 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx @@ -69,19 +69,20 @@ call.create( ```bash -curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "data": { - "created_by_id": "sacha@getstream.io", - "members": [ - { "role": "speaker", "user_id": "sacha@getstream.io" } - ], - "custom": { "color": "blue" } - } - }' +# Gets or creates a call +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "data": { + "created_by_id": "sacha@getstream.io", + "members": [ + { "role": "admin", "user_id": "sacha@getstream.io" } + ], + "custom": { "color": "blue" } + } + }' ``` diff --git a/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx b/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx index 71fc7261..f03b162d 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx @@ -18,5 +18,22 @@ call.goLive({ start_hls: true, start_recording: true }); call.go_live(start_hls=True, start_recording=True) ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}/go_live?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +# optionally start HLS broadcast and/or recording +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}/go_live?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ "start_hls": true, "start_recording": true }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx b/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx index 4b6e844e..0a30a8c1 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/manage-call-members.mdx @@ -35,16 +35,17 @@ call.update_call_members( ```bash -curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}/members?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "update_members": [ - { "user_id": "sara" }, - { "user_id": "emily", "role": "admin" } - ] - }' +# You can only add existing members to a call +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "update_members": [ + { "user_id": "sara" }, + { "user_id": "john", "role": "admin" } + ] + }' ``` @@ -68,5 +69,18 @@ call.updateCallMembers({ call.update_call_members(remove_members=["jack", "sara"]) ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "remove_members": ["sara"] + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx index fc5849fd..aba0b793 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx @@ -45,5 +45,17 @@ rtmp_url = response.data.call.ingress.rtmp.address print(rtmp_url, stream_key) ``` + + + +```bash +# RTMP URL is: response.call.rtmp.address +curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +# Stream key: create a user token +``` + diff --git a/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx b/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx index 7b3504b6..7e3e017d 100644 --- a/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx +++ b/docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx @@ -40,17 +40,18 @@ call.update( ```bash -curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "settings_override": { - "audio": { - "mic_default_on": true - } +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "audio": { + "mic_default_on": true, + "default_device": "speaker" } - }' + } + }' ``` diff --git a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx index 3a819224..1af0721c 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/authentication.mdx @@ -53,6 +53,29 @@ client.upsert_users( ) ``` + + + +```bash +curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ +-H "Authorization: ${TOKEN}" \ +-H "stream-auth-type: jwt" \ +-H "Content-Type: application/json" \ +-d '{ + "users": { + "john": { + "id": "john", + "role": "user", + "custom": { + "color": "red" + }, + "name": "John", + "image": "link/to/profile/image" + } + } +}' +``` + @@ -124,6 +147,47 @@ client.update_users_partial( ) ``` + + + +```bash +# Upserting a user, all existing user data will be overridden +curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "users": { + "john": { + "id": "john", + "role": "user", + "custom": { + "color": "red" + }, + "name": "John", + "image": "link/to/profile/image" + } + } + }' + +# Partial update +curl -X PATCH https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "users": [ + { + "id": "john", + "set": { + "color": "blue" + }, + "unset": ["name"] + } + ] + }' +``` + @@ -153,7 +217,7 @@ Deleting a user means: Delete has the following opitions: | Name | Type | Description | Optional | -|------------------------|----------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| +| ---------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | `user` | Enum (soft, pruning, hard) | - Soft: marks user as deleted and retains all user data.
- Pruning: marks user as deleted and nullifies user information.
- Hard: deletes user completely - this requires hard option for messages and conversation as well. | Yes | | `conversations` | Enum (soft, hard) | - Soft: marks all conversation channels as deleted (same effect as Delete Channels with 'hard' option disabled).
- Hard: deletes channel and all its data completely including messages (same effect as Delete Channels with 'hard' option enabled). | Yes | | `messages` | Enum (soft, pruning, hard) | - Soft: marks all user messages as deleted without removing any related message data.
- Pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags.
- Hard: deletes messages completely with all related information. | Yes | @@ -198,6 +262,47 @@ client.delete_users(user_ids=[""]) client.restore_users(user_ids=[""]) ``` + + + +```bash +# Deactivate users +curl -X POST https://video.stream-io-api.com/api/v2/users/deactivate?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' + +# Reactivate users +curl -X POST https://video.stream-io-api.com/api/v2/users/deactivate?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' + +# Delete users +curl -X POST https://video.stream-io-api.com/api/v2/users/delete?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' + +# Restore users +curl -X POST https://video.stream-io-api.com/api/v2/users/restore?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx index 5fb518e2..5cb5e9da 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/calls.mdx @@ -39,6 +39,24 @@ await client.call('default', 'test-outgoing-call').getOrCreate({ }); ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "ring": true, + "data": { + "created_by_id": "myself", + "members": [{ "user_id": "myself" }, { "user_id": "my friend" }] + } + }' +``` + @@ -65,6 +83,23 @@ await client.call('default', 'test-outgoing-call').getOrCreate({ }); ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "notify": true, + "data": { + "created_by_id": "myself", + "members": [{ "user_id": "myself" }, { "user_id": "my friend" }] + } + }' +``` + @@ -110,6 +145,24 @@ await client.video.updateCallType(callTypeName, { }); ``` + + + + +```bash +# Remove join call grant from user role, only include this for call_member role +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "grants": { + "user": [...list all grants for user here], + "call_member": [...list all grants for call member here, "join-call"] + } + }' +``` + @@ -132,6 +185,16 @@ This action terminates the call for everyone. Ending a call requires the `end-ca await call.endCall(); ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/mark_ended?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + @@ -195,6 +258,26 @@ client.query_calls( ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ "sort": [{ "field": "starts_at", "direction": -1 }], "limit": 2 }' + +# Loading next page +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ "sort": [{ "field": "starts_at", "direction": -1 }], "limit": 2, "next": "" }' +``` + + + #### Query live calls @@ -218,6 +301,18 @@ client.video.query_calls( ) ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ "filter_conditions": { "backstage": { "$eq": false } } }' +``` + @@ -227,7 +322,7 @@ client.video.query_calls( ```js -const mins30 = 1000 * 60 * 60 * 30; +const mins30 = 1000 * 60 * 30; const inNext30mins = new Date(Date.now() + mins30); client.video.queryCalls({ filter_conditions: { @@ -250,6 +345,19 @@ client.video.query_calls( ``` + + + + +```bash +# Provide the time in ISO date string +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ "filter_conditions": { "starts_at": { "$gt": "2024-05-10T09:09:03.584Z" } } }' +``` + @@ -274,6 +382,20 @@ client.video.query_calls( ) ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "filter_conditions": { "ongoing": { "$eq": true } } + }' +``` + @@ -342,6 +464,57 @@ call.query_members( ) ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "id": "'${CALL_ID}'", + "type": "'${CALL_TYPE}'" + }' + +# Sorting and pagination +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "id": "'${CALL_ID}'", + "type": "'${CALL_TYPE}'", + "sort": [{ "field": "user_id", "direction": 1 }], + "limit": 2 + }' + +# Load next page +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "id": "'${CALL_ID}'", + "type": "'${CALL_TYPE}'", + "sort": [{ "field": "user_id", "direction": 1 }], + "limit": 2, + "next": "" + }' + +# Filtering +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/members?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "id": "'${CALL_ID}'", + "type": "'${CALL_TYPE}'", + "filter_conditions": { "role": { "$eq": "admin" } } + }' +``` + @@ -371,6 +544,26 @@ await call.sendCustomEvent({ }); ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/event?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "event": { + "custom": { + "type": "draw", + "x": 10, + "y": 30 + } + } + }' +``` + @@ -395,5 +588,30 @@ await call.unpinVideo({ }); ``` + + + +```bash +# Pin video +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/pin?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "session_id": "session-id", + "user_id": "user-id-to-unpin" + }' + +# Unpin video +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/unpin?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "session_id": "session-id", + "user_id": "user-id-to-unpin" + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx index 58c7ae39..df1c922b 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/get_started.mdx @@ -136,6 +136,30 @@ client.upsert_users( client.create_token(user_id="tommaso-id", expiration=3600) ``` + + + + +```bash +curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ +-H "Authorization: ${TOKEN}" \ +-H "stream-auth-type: jwt" \ +-H "Content-Type: application/json" \ +-d '{ + "users": { + "john": { + "id": "john", + "role": "user", + "custom": { + "color": "red" + }, + "name": "John", + "image": "link/to/profile/image" + } + } +}' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx index d8a89310..13e6c0e7 100644 --- a/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx +++ b/docusaurus/video/docusaurus/docs/api/basics/multi-tenant.mdx @@ -47,6 +47,25 @@ print(client.get_app().data.app.multi_tenant_enabled) client.update_app(multi_tenant_enabled=True) ``` + + + +```bash +# Check status +curl -X GET "https://video.stream-io-api.com/api/v2/app?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +# Enable multi tenant +curl -X PATCH "https://video.stream-io-api.com/api/v2/app?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + multi_tenant_enabled: true, + }' +``` + @@ -80,6 +99,25 @@ client.upsert_users( ) ``` + + + + +```bash +curl -X POST https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY} \ +-H "Authorization: ${TOKEN}" \ +-H "stream-auth-type: jwt" \ +-H "Content-Type: application/json" \ +-d '{ + "users": { + "john": { + "id": "john", + "teams": ["red", "blue"] + } + } +}' +``` + @@ -113,6 +151,24 @@ response = call.create( ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "data": { + "created_by_id": "sacha@getstream.io", + "team": "blue" + } + }' +``` + + + Call teams allow you to ensure proper permission checking for a multi tenant application. Keep in mind that you will still need to enforce that call IDs are unique. @@ -170,6 +226,29 @@ response = client.query_users( ``` + + + +```bash +# Search for users by name and team +PAYLOAD='{"filter_conditions": {"name": "Nick", "teams": { "$in": ["red", "blue"] }}}'; +ENCODED_PAYLOAD=$(echo ${PAYLOAD} | perl -MURI::Escape -lne 'print uri_escape($_)') + +curl -X GET "https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY}&payload=${ENCODED_PAYLOAD}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +Search for users that are not part of any team +PAYLOAD='{"filter_conditions": {"name": "Tom", "teams": null}}'; +ENCODED_PAYLOAD=$(echo ${PAYLOAD} | perl -MURI::Escape -lne 'print uri_escape($_)') + +curl -X GET "https://video.stream-io-api.com/api/v2/users?api_key=${API_KEY}&payload=${ENCODED_PAYLOAD}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + + + ## Query Calls @@ -215,5 +294,30 @@ response = client.video.query_calls( ) ``` + + + + +```bash +# All calls +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +# Calls without team +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{"filter_conditions": {"team": null}}' + +# Calls with a specific team +curl -X POST "https://video.stream-io-api.com/api/v2/video/calls?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{"filter_conditions": {"team": "blue"}}' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx b/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx index 28d98afb..13abf514 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/geofencing.mdx @@ -75,5 +75,41 @@ call.create( ), ) ``` + + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "", + "settings": { + "geofencing": { + "names": ["european_union"] + } + } +}' + +# override on call level +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "data": { + "created_by_id": "john", + "settings_override": { + "geofencing": { + "names": ["european_union", "united_states"] + } + } + } + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx index ff8e54bc..74c4007f 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/manage-types.mdx @@ -17,7 +17,7 @@ import TabItem from '@theme/TabItem'; client.video.listCallTypes(); //or -client.getCallType({name: 'livestream'}); +client.getCallType({ name: 'livestream' }); ``` @@ -29,7 +29,24 @@ client.video.list_call_types() # or client.get_call_type(name= 'livestream') ``` + + + + +```bash +curl -X GET "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" + +# or +curl -X GET "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + + + ## Create call type @@ -74,6 +91,28 @@ client.video.create_call_type( ) ``` + + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "allhands", + "settings": { + "audio": { "mic_default_on": true, "default_device": "speaker" } + }, + "grants": { + "admin": ["send-audio", "send-video", "mute-users"], + "user": ["send-audio", "send-video"] + } + }' +``` + @@ -95,12 +134,29 @@ client.video.updateCallType('allhands', { ```py -client.video.update_call_type(name='allhands', +client.video.update_call_type(name='allhands', settings= CallSettingsRequest( audio=AudioSettingsRequest( mic_default_on= False, default_device= 'earpiece' ), ), ) ``` + + + + + +```bash +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "audio": { "mic_default_on": false, "default_device": "earpiece" } + } + }' +``` + @@ -110,7 +166,7 @@ client.video.update_call_type(name='allhands', ```js -client.video.deleteCallType({name: 'allhands'}); +client.video.deleteCallType({ name: 'allhands' }); ``` @@ -120,5 +176,16 @@ client.video.deleteCallType({name: 'allhands'}); client.video.delete_call_type(name= 'allhands') ``` + - \ No newline at end of file + + + +```bash +curl -X DELETE "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + + + diff --git a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx index d5c0aa41..62de8915 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/permissions.mdx @@ -73,13 +73,45 @@ client.video.create_call_type( }, ) -client.video.update_call_type(name = 'default', +client.video.update_call_type(name = 'default', grants= { /* ... */ }, ) ``` + + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "", + "settings": { + "audio": { "mic_default_on": true, "default_device": "speaker" } + }, + "grants": { + "admin": ["send-audio", "send-video", "mute-users"], + "customrole": ["send-audio", "send-video"] + } + }' + +# or edit a built-in call type +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/default?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "grants": {...} + }' +``` + + ### Built-in roles diff --git a/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx b/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx index 9b923205..c3e5819a 100644 --- a/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx +++ b/docusaurus/video/docusaurus/docs/api/call_types/settings.mdx @@ -77,6 +77,43 @@ call.create( ), ) ``` + + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "", + "settings": { + "screensharing": { + "access_request_enabled": false, + "enabled": true + } + } + }' + +# override settings on call +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "data": { + "created_by_id": "john", + "settings_override": { + "screensharing": { + "enabled": false + } + } + } + }' +``` + @@ -124,6 +161,33 @@ client.video.create_call_type( ), ) ``` + + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/calltypes?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "name": "", + "notification_settings": { + "enabled": true, + "call_notification": { + "apns": { + "title": "{{ user.display_name }} invites you to a call" + }, + "enabled": true + }, + "session_started": { + "enabled": false + } + } + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx index 3d599ff7..099c9716 100644 --- a/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx +++ b/docusaurus/video/docusaurus/docs/api/moderation/overview.mdx @@ -44,6 +44,29 @@ call.block_user(user_id='sara') call.unblock_user(user_id='sara') ``` + + + +```bash +# Block user +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/unblock?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_id": "sara" + }' + +# Unblock user +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/unblock?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_id": "sara" + }' +``` + @@ -77,6 +100,27 @@ call.update( ) ``` + + + +```bash +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "data": { + "created_by_id": "john", + "settings_override": { + "screensharing": { + "enabled": true, + "access_request_enabled": true + } + } + } + }' +``` + @@ -106,6 +150,21 @@ call.mute_users( ) ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/mute_users?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "mute_all_users": true, + "audio": true, + "muted_by_id": "john" + }' +``` + @@ -138,6 +197,24 @@ call.mute_users( ) ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/mute_users?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "user_ids": ["sara"], + "audio": true, + "video": true, + "screenshare": true, + "screenshare_audio": true, + "muted_by_id": "john" + }' +``` + @@ -175,6 +252,17 @@ call.update_user_permissions( ) ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/user_permissions?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ "user_id": "sara", "grant_permissions": ["send-audio"] }' +``` + @@ -208,6 +296,17 @@ call.update_user_permissions( ) ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/user_permissions?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ "user_id": "sara", "revoke_permissions": ["send-audio"] }' +``` + @@ -252,6 +351,54 @@ client.ban( ) ``` + + + + +```bash +# Ban a user +curl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "target_user_id": "sara", + "banned_by_id": "john", + "reason": "banned reason here" + }' + +# Removes ban for user +curl -X DELETE https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "target_user_id": "sara" + }' + +# Ban a user for 30 minutes +curl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "target_user_id": "sara", + "banned_by_id": "john", + "timeout": 30 + }' + +# Ban a user and all users sharing the same IP +curl -X POST https://video.stream-io-api.com/api/v2/moderation/ban?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "target_user_id": "sara", + "banned_by_id": "john", + "ip_ban": true + }' +``` + @@ -288,5 +435,29 @@ if task_status.data.status == "completed": print(task_status.data.result) ``` + + + + +```bash +# Deactivate users +curl -X POST https://video.stream-io-api.com/api/v2/users/deactivate?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' + +# Reactivate users +curl -X POST https://video.stream-io-api.com/api/v2/users/deactivate?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "user_ids": ["sara"] + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx index 41cb090e..1621c5a3 100644 --- a/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx @@ -5,7 +5,6 @@ slug: /recording/calls title: Recording calls --- - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -45,13 +44,11 @@ call.stop_recording() ```bash curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/start_recording?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/stop_recording?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" ``` @@ -81,7 +78,7 @@ call.list_recordings() ```bash curl "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/recordings?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" ``` @@ -145,6 +142,7 @@ call.update({ call.update({ settings_override: { recording: { + mode: VideoRecordSettingsRequestModeEnum.AVAILABLE, audio_only: false, quality: VideoRecordSettingsRequestQualityEnum._1080P, }, @@ -208,6 +206,66 @@ call.update( ) ``` + + + + +```bash +# Disable on call level +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "recording": { + "mode": "disabled" + } + } + }' + +# Enable on call level +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "recording": { + "mode": "available" + } + } + }' + +# Other settings +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "recording": { + "mode": "available", + "audio_only": false, + "quality": "1080p" + } + } +}' + +# Enable/disable on call type level +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "recording": { + "mode": "disabled" + } + } + }' +``` + @@ -246,6 +304,26 @@ call.update( ``` + + + +```bash +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/default/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "recording": { + "mode": "available", + "audio_only": true + } + } +}' +``` + + + ## Recording layouts @@ -307,7 +385,7 @@ Each layout has a number of options that you can configure. Here is an example: ```js const layoutOptions = { 'logo.image_url': - 'https://theme.zdassets.com/theme_assets/9442057/efc3820e436f9150bc8cf34267fff4df052a1f9c.png', + 'https://theme.zdassets.com/theme_assets/9442057/efc3820e436f9150bc8cf34267fff4df052a1f9c.png', 'logo.horizontal_position': 'center', 'title.text': 'Building Stream Video Q&A', 'title.horizontal_position': 'center', @@ -373,6 +451,43 @@ client.video.update_call_type( ) ``` + + + + +```bash +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "recording": { + "mode": "available", + "audio_only": false, + "quality": "1080p", + "layout": { + "name": "spotlight", + "options": { + "logo.image_url": "https://theme.zdassets.com/theme_assets/9442057/efc3820e436f9150bc8cf34267fff4df052a1f9c.png", + "logo.horizontal_position": "center", + "title.text": "Building Stream Video Q&A", + "title.horizontal_position": "center", + "title.color": "black", + "participant_label.border_radius": "0px", + "participant.border_radius": "0px", + "layout.spotlight.participants_bar_position": "top", + "layout.background_color": "#f2f2f2", + "participant.placeholder_background_color": "#1f1f1f", + "layout.single-participant.padding_inline": "20%", + "participant_label.background_color": "transparent" + } + } + } + } + }' +``` + @@ -515,6 +630,30 @@ client.video.update_call_type( ) ``` + + + + +```bash +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "recording": { + "mode": "available", + "audio_only": false, + "quality": "1080p", + "layout": { + "name": "spotlight", + "external_css_url": "https://path/to/custom.css" + } + } + } + }' +``` + @@ -565,6 +704,29 @@ client.video.update_call_type( ) ``` + + + +```bash +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "recording": { + "mode": "available", + "audio_only": false, + "quality": "1080p", + "layout": { + "name": "custom", + "external_app_url": "https://path/to/layout/app" + } + } + } + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/recording/storage.mdx b/docusaurus/video/docusaurus/docs/api/recording/storage.mdx index 45d160f7..ecbaf82f 100644 --- a/docusaurus/video/docusaurus/docs/api/recording/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/recording/storage.mdx @@ -5,7 +5,6 @@ slug: /recording/storage title: Storage --- - import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -34,23 +33,23 @@ Alternatively, you can also have the storage configured and use it for specific ```js // 1. create a new storage with all the required parameters await serverSideClient.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-s3', - storage_type: 's3', - path: 'directory_name/', - aws_s3: { - s3_region: 'us-east-1', - s3_api_key: 'my-access-key', - s3_secret: 'my-secret', - }, + bucket: 'my-bucket', + name: 'my-s3', + storage_type: 's3', + path: 'directory_name/', + aws_s3: { + s3_region: 'us-east-1', + s3_api_key: 'my-access-key', + s3_secret: 'my-secret', + }, }); // 2. update the call type to use the new storage await serverSideClient.updateCallType('my-call-type', { - external_storage: "my-s3", + external_storage: 'my-s3', }); // 3. alternative, specify the storage when starting call recording await call.startRecording({ - recording_external_storage: "my-s3", + recording_external_storage: 'my-s3', }); ``` @@ -84,9 +83,9 @@ call.start_recording(recording_external_storage= "my-s3") ```bash curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ -d '{ "name": "my-storage", "storage_type": "s3", @@ -99,16 +98,16 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP } }' -curl -X PATCH https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ +curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ -d '{ - "external_storage": "my-storage" + "external_storage": "my-storage" }' curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/start_recording?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "Content-Type: application/json" \ -H "stream-auth-type: jwt" \ -d '{ @@ -119,7 +118,7 @@ curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/star -*Note*: recording are only uploaded to the storage when the call is completed or when `stop_recording` is called, whichever comes first. +_Note_: recording are only uploaded to the storage when the call is completed or when `stop_recording` is called, whichever comes first. ### Multiple storage providers and default storage @@ -140,12 +139,12 @@ Note: all Stream applications have Stream S3 storage enabled by default. You can // 1. update the call type to use Stream S3 storage await serverSideClient.updateCallType('my-call-type', { - external_storage: "stream-s3", + external_storage: 'stream-s3', }); - // 2. specify Stream S3 storage when starting call recording +// 2. specify Stream S3 storage when starting call recording await call.startRecording({ - recording_external_storage: "my-storage", + recording_external_storage: 'my-storage', }); ``` @@ -165,21 +164,21 @@ call.start_recording(recording_external_storage="my-storage") ```bash -curl -X PATCH https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "external_storage": "my-first-storage" - }' - -curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/start_recording?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "recording_external_storage": "my-second-storage" - }' +curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY} \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "external_storage": "my-first-storage" + }' + +curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/start_recording?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "recording_external_storage": "my-second-storage" + }' ``` @@ -187,12 +186,12 @@ curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/star ## Storage configuration -| Name | Description | Required | -|---------------|-------------|----------| -| name |unique name | yes | -| storage_type |s3, gcs or abs| yes | -| bucket |bucket name| yes | -| custom_folder |path inside the bucket| | +| Name | Description | Required | +| ------------- | ---------------------- | -------- | +| name | unique name | yes | +| storage_type | s3, gcs or abs | yes | +| bucket | bucket name | yes | +| custom_folder | path inside the bucket | | ## Amazon S3 @@ -201,40 +200,35 @@ To use Amazon S3 as your storage provider, you have two authentication options: If you do not specify the `s3_api_key` parameter, Stream will use IAM role authentication. In that case make sure to have the correct IAM role configured for your application. | Name | Required | -|------------|----------| -| s3_region | yes | +| ---------- | -------- | +| s3_region | yes | | s3_api_key | | | s3_secret | | There are 2 ways to configure authentication on your S3 bucket: + - By providing a key and secret - Or by having Stream's AWS account assume a role on S3 bucket. -With this option you omit the key and secret, but instead you set up a resource-based policy to grant Stream SendMessage permission on your S3 bucket. -The following policy needs to be attached to your queue (replace the value of Resource with the fully qualified ARN of you S3 bucket): - + With this option you omit the key and secret, but instead you set up a resource-based policy to grant Stream SendMessage permission on your S3 bucket. + The following policy needs to be attached to your queue (replace the value of Resource with the fully qualified ARN of you S3 bucket): ### Example S3 policy ```json { - "Version": "2012-10-17", - "Id": "StreamExternalStoragePolicy", - "Statement": [ - { - "Sid": "ExampleStatement01", - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::185583345998:root" - }, - "Action": [ - "s3:PutObject" - ], - "Resource": [ - "arn:aws:s3:::bucket_name/*", - "arn:aws:s3:::bucket_name" - ] - } - ] + "Version": "2012-10-17", + "Id": "StreamExternalStoragePolicy", + "Statement": [ + { + "Sid": "ExampleStatement01", + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::185583345998:root" + }, + "Action": ["s3:PutObject"], + "Resource": ["arn:aws:s3:::bucket_name/*", "arn:aws:s3:::bucket_name"] + } + ] } ``` @@ -251,11 +245,11 @@ Note: you can find the JSON service account credentials in the Google Cloud Cons // 1. create a new storage using the service account credentials await serverSideClient.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-gcs', - storage_type: 'gcs', - path: 'directory_name/', - "gcs_credentials": "content of the service account file", + bucket: 'my-bucket', + name: 'my-gcs', + storage_type: 'gcs', + path: 'directory_name/', + gcs_credentials: 'content of the service account file', }); ``` @@ -279,16 +273,16 @@ response = client.video.create_external_storage( ```bash curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "stream-auth-type: jwt" \ - -d '{ - "name": "my-storage", - "storage_type": "gcs", - "bucket": "my-bucket", - "custom_folder": "my-folder", - "gcs_credentials": "content of the service account file" - }' + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "name": "my-storage2", + "storage_type": "gcs", + "bucket": "my-bucket", + "custom_folder": "my-folder", + "gcs_credentials": "content of the service account file" + }' ``` @@ -298,12 +292,12 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP ```json { - "bindings": [ - { - "role": "roles/storage.objectCreator", - "members": ["service_account_principal_identifier"] - } - ] + "bindings": [ + { + "role": "roles/storage.objectCreator", + "members": ["service_account_principal_identifier"] + } + ] } ``` @@ -312,6 +306,6 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP To use Azure Blob Storage as your storage provider, you need to create a container and a service principal with the following parameters: | Name | Description | Required | -|------------------|-------------|----------| +| ---------------- | ----------- | -------- | | abs_account_name | | yes | | abs_account_key | | yes | diff --git a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx index a152224b..f1774bd3 100644 --- a/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx +++ b/docusaurus/video/docusaurus/docs/api/streaming/backstage.mdx @@ -65,6 +65,37 @@ client.video.update_call_type( ) ``` + + + +```bash +# call level update +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAME}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "backstage": { + "enabled": true + } + } + }' + +# call type level update +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "backstage": { + "enabled": true + } + } + }' +``` + @@ -95,6 +126,21 @@ client.video.update_call_type( ) ``` + + + +```bash +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "grants": { + "host": ["join-backstage"] + } + }' +``` + @@ -130,5 +176,14 @@ call.stopLive(); call.stop_live() ``` + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAME}/${CALL_ID}/stop_live?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + diff --git a/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx b/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx index 9ebcfe1c..422f87e8 100644 --- a/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx +++ b/docusaurus/video/docusaurus/docs/api/streaming/hls.mdx @@ -50,6 +50,17 @@ const isBroadcasting = resp.call.egress.broadcasting; response = call.get() print(f"broadcasting: {response.data.call.egress.broadcasting}") ``` + + + + +```bash +# Broadcasting state: resp.call.egress.broadcasting +curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + @@ -82,5 +93,17 @@ response = call.get() # the URL of the HLS stream response.data.call.egress.hls.playlist_url ``` + + + + + +```bash +# Broadcasting URL: resp.call.egress.hls.playlist_url +curl -X GET "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" +``` + diff --git a/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx b/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx index 95abd1c6..a0882d71 100644 --- a/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx +++ b/docusaurus/video/docusaurus/docs/api/streaming/overview.mdx @@ -64,6 +64,25 @@ response = call.create( ) ``` + + + + +```bash +curl -X POST "https://video.stream-io-api.com/api/v2/video/call/livestream/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "Content-Type: application/json" \ + -H "stream-auth-type: jwt" \ + -d '{ + "data": { + "created_by_id": "john", + "members": [ + { "role": "host", "user_id": "john" } + ] + } + }' +``` + diff --git a/docusaurus/video/docusaurus/docs/api/transcription/storage.mdx b/docusaurus/video/docusaurus/docs/api/transcription/storage.mdx index d7b49323..fa761405 100644 --- a/docusaurus/video/docusaurus/docs/api/transcription/storage.mdx +++ b/docusaurus/video/docusaurus/docs/api/transcription/storage.mdx @@ -33,25 +33,26 @@ Alternatively, you can also have the storage configured and use it for specific ```js // 1. create a new storage with all the required parameters await serverSideClient.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-s3', - storage_type: 's3', - path: 'directory_name/', - aws_s3: { - s3_region: 'us-east-1', - s3_api_key: 'my-access-key', - s3_secret: 'my-secret', - }, + bucket: 'my-bucket', + name: 'my-s3', + storage_type: 's3', + path: 'directory_name/', + aws_s3: { + s3_region: 'us-east-1', + s3_api_key: 'my-access-key', + s3_secret: 'my-secret', + }, }); // 2. update the call type to use the new storage await serverSideClient.updateCallType('my-call-type', { - external_storage: "my-s3", + external_storage: 'my-s3', }); // 3. alternative, specify the storage when starting call transcribing await call.startTranscription({ - transcription_external_storage: "my-s3", + transcription_external_storage: 'my-s3', }); ``` + @@ -76,13 +77,14 @@ client.video.update_call_type(name='allhands', external_storage= "my-s3") # 3. alternative, specify the storage when starting call transcribing call.start_transcription(transcription_external_storage= "my-s3") ``` + ```bash # 1. create a new storage with all the required parameters curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "Content-Type: application/json" \ -H "stream-auth-type: jwt" \ -d '{ @@ -99,7 +101,7 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP # 2. update the call type to use the new storage curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "Content-Type: application/json" \ -H "stream-auth-type: jwt" \ -d '{ @@ -108,7 +110,7 @@ curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE}?api_key # 3. alternative, specify the storage when starting call transcribing curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/start_transcription?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "Content-Type: application/json" \ -H "stream-auth-type: jwt" \ -d '{ @@ -119,7 +121,7 @@ curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID} -*Note*: transcribing are only uploaded to the storage when the call is completed or when `stop_transcription` is called, whichever comes first. +_Note_: transcribing are only uploaded to the storage when the call is completed or when `stop_transcription` is called, whichever comes first. ### Multiple storage providers and default storage @@ -140,12 +142,12 @@ Note: all Stream applications have Stream S3 storage enabled by default. You can // 1. update the call type to use Stream S3 storage await serverSideClient.updateCallType('my-call-type', { - external_storage: "stream-s3", + external_storage: 'stream-s3', }); // 2. specify Stream S3 storage when starting call transcribing await call.startTranscription({ - transcription_external_storage: "my-storage", + transcription_external_storage: 'my-storage', }); ``` @@ -166,7 +168,7 @@ call.start_transcription(transcription_external_storage="my-storage") ```bash # 1. update the call type to use Stream S3 storage curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \ --H "Authorization: ${JWT_TOKEN}" \ +-H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H 'Content-Type: application/json' \ -d '{ @@ -175,7 +177,7 @@ curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE}?api_key # 2. specify Stream S3 storage when starting call transcribing curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/start_transcription?api_key=${API_KEY}" \ --H "Authorization: ${JWT_TOKEN}" \ +-H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H 'Content-Type: application/json' \ -d '{ @@ -189,7 +191,7 @@ curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID} ## Storage configuration | Name | Description | Required | -|---------------|-------------|----------| +| ------------- | ----------- | -------- | | name | | | | storage_type | | | | bucket | | | @@ -202,40 +204,35 @@ To use Amazon S3 as your storage provider, you have two authentication options: If you do not specify the `s3_api_key` parameter, Stream will use IAM role authentication. In that case make sure to have the correct IAM role configured for your application. | Name | Description | Required | -|------------|-------------|----------| -| s3_region | | yes | +| ---------- | ----------- | -------- | +| s3_region | | yes | | s3_api_key | | | | s3_secret | | | There are 2 ways to configure authentication on your S3 bucket: + - By providing a key and secret - Or by having Stream's AWS account assume a role on your SQS queue. -With this option you omit the key and secret, but instead you set up a resource-based policy to grant Stream SendMessage permission on your S3 bucket. -The following policy needs to be attached to your queue (replace the value of Resource with the fully qualified ARN of you S3 bucket): - + With this option you omit the key and secret, but instead you set up a resource-based policy to grant Stream SendMessage permission on your S3 bucket. + The following policy needs to be attached to your queue (replace the value of Resource with the fully qualified ARN of you S3 bucket): ### Example S3 policy ```json { - "Version": "2012-10-17", - "Id": "StreamExternalStoragePolicy", - "Statement": [ - { - "Sid": "ExampleStatement01", - "Effect": "Allow", - "Principal": { - "AWS": "arn:aws:iam::185583345998:root" - }, - "Action": [ - "s3:PutObject" - ], - "Resource": [ - "arn:aws:s3:::bucket_name/*", - "arn:aws:s3:::bucket_name" - ] - } - ] + "Version": "2012-10-17", + "Id": "StreamExternalStoragePolicy", + "Statement": [ + { + "Sid": "ExampleStatement01", + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::185583345998:root" + }, + "Action": ["s3:PutObject"], + "Resource": ["arn:aws:s3:::bucket_name/*", "arn:aws:s3:::bucket_name"] + } + ] } ``` @@ -252,11 +249,11 @@ Note: you can find the JSON service account credentials in the Google Cloud Cons // 1. create a new storage using the service account credentials await serverSideClient.createExternalStorage({ - bucket: 'my-bucket', - name: 'my-gcs', - storage_type: 'gcs', - path: 'directory_name/', - "gcs_credentials": "content of the service account file", + bucket: 'my-bucket', + name: 'my-gcs', + storage_type: 'gcs', + path: 'directory_name/', + gcs_credentials: 'content of the service account file', }); ``` @@ -273,6 +270,7 @@ response = client.video.create_external_storage( gcs_credentials="content of the service account file" ) ``` + @@ -280,7 +278,7 @@ response = client.video.create_external_storage( ```bash curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${API_KEY} \ --H "Authorization: ${JWT_TOKEN}" \ +-H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" \ -H 'Content-Type: application/json' \ -d '{ @@ -300,12 +298,12 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP ```json { - "bindings": [ - { - "role": "roles/storage.objectCreator", - "members": ["service_account_principal_identifier"] - } - ] + "bindings": [ + { + "role": "roles/storage.objectCreator", + "members": ["service_account_principal_identifier"] + } + ] } ``` @@ -314,6 +312,6 @@ curl -X POST https://video.stream-io-api.com/video/external_storage?api_key=${AP To use Azure Blob Storage as your storage provider, you need to create a container and a service principal with the following parameters: | Name | Description | Required | -|------------------|-------------|----------| +| ---------------- | ----------- | -------- | | abs_account_name | | yes | | abs_account_key | | yes | diff --git a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx index 11139a8e..b27c8991 100644 --- a/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx +++ b/docusaurus/video/docusaurus/docs/api/transcription/transcribing_calls.mdx @@ -8,13 +8,13 @@ title: Call Transcriptions import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -You can transcribe calls to text using API calls or configure your call types to be automatically transcribed. When transcription is enabled automatically, the transcription process will start when the first user joins the call, and then stop when all participant have left the call. +You can transcribe calls to text using API calls or configure your call types to be automatically transcribed. When transcription is enabled automatically, the transcription process will start when the first user joins the call, and then stop when all participant have left the call. Transcriptions are structured as plain-text JSONL files and automatically uploaded to Stream managed storage or to your own configurable storage. Websocket and webhook events are also sent when transcription starts, stops and completes. Stream supports transcribing calls in multiple languages as well as transcriptions for closed captions. You can find more information about both later in this document. -> **Note:**: we transcribe 1 dominant speaker and 2 other participants at a time +> **Note** we transcribe 1 dominant speaker and 2 other participants at a time ## Quick Start @@ -45,13 +45,11 @@ call.stop_transcription() ```bash curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/start_transcription?api_key=${API_KEY}"\ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" curl -X POST "https://video.stream-io-api.com/video/call/default/${CALL_ID}/stop_transcription?api_key=${API_KEY}"\ - -H "Authorization: ${JWT_TOKEN}" \ - -H "Content-Type: application/json" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" ``` @@ -83,7 +81,7 @@ call.list_transcriptions() ```bash curl "https://video.stream-io-api.com/video/call/default/${CALL_ID}/transcriptions?api_key=${API_KEY}" \ - -H "Authorization: ${JWT_TOKEN}" \ + -H "Authorization: ${TOKEN}" \ -H "stream-auth-type: jwt" ``` @@ -100,32 +98,33 @@ These events are sent to users connected to the call and your webhook/SQS: - `call.transcription_failed` sent if the transcription process encounters any issues. ## `transcription.ready` event example + ```json { - "type": "call.transcription_ready", - "created_at": "2024-03-18T08:24:14.769328551Z", - "call_cid": "default:mkzN17EUrgvn", - "call_transcription": { - "filename": "transcript_default_mkzN17EUrgvn_1710750207642.jsonl", - "url": "https://frankfurt.stream-io-cdn.com/1129528/video/transcriptions/default_mkzN17EUrgvn/transcript_default_mkzN17EUrgvn_1710750207642.jsonl?Expires=1710751154&Signature=OhdoTClQm5MT8ITPLAEJcKNflsJ7B2G3j7kx~kQyPrAETftrM2rzZy4IIT1XIC~8MrbPduWcj1tILXoSg3ldfZEHWRPqeMFr0caljPAVAL~mybUb4Kct2JoPjfsYfmj4FzSQbT7Iib38qPr7uiP0axTFm0VKRenkNwwCoS0F858u9Mdr8r6fTzILhiOZ1hOjw3V-TT1YbR20Yn4abKi6i50GAs5fqUDtSlo9DmEJgcS79Y0wUD1g18cGZvg3NiH3ogHQnmvoNrf28Cxc0JhBCe4wFErCMJ3pinewEOwDEEOMdHcRtcfWy72w6MTEwi0yomHYIU5flaYgUXCkkOJODw__&Key-Pair-Id=APKAIHG36VEWPDULE23Q", - "start_time": "2024-03-18T08:23:27.642688204Z", - "end_time": "2024-03-18T08:24:14.754731786Z" - }, - "received_at": "2024-03-18T08:24:14.790Z" + "type": "call.transcription_ready", + "created_at": "2024-03-18T08:24:14.769328551Z", + "call_cid": "default:mkzN17EUrgvn", + "call_transcription": { + "filename": "transcript_default_mkzN17EUrgvn_1710750207642.jsonl", + "url": "https://frankfurt.stream-io-cdn.com/1129528/video/transcriptions/default_mkzN17EUrgvn/transcript_default_mkzN17EUrgvn_1710750207642.jsonl?Expires=1710751154&Signature=OhdoTClQm5MT8ITPLAEJcKNflsJ7B2G3j7kx~kQyPrAETftrM2rzZy4IIT1XIC~8MrbPduWcj1tILXoSg3ldfZEHWRPqeMFr0caljPAVAL~mybUb4Kct2JoPjfsYfmj4FzSQbT7Iib38qPr7uiP0axTFm0VKRenkNwwCoS0F858u9Mdr8r6fTzILhiOZ1hOjw3V-TT1YbR20Yn4abKi6i50GAs5fqUDtSlo9DmEJgcS79Y0wUD1g18cGZvg3NiH3ogHQnmvoNrf28Cxc0JhBCe4wFErCMJ3pinewEOwDEEOMdHcRtcfWy72w6MTEwi0yomHYIU5flaYgUXCkkOJODw__&Key-Pair-Id=APKAIHG36VEWPDULE23Q", + "start_time": "2024-03-18T08:23:27.642688204Z", + "end_time": "2024-03-18T08:24:14.754731786Z" + }, + "received_at": "2024-03-18T08:24:14.790Z" } - ``` + ## Transcription JSONL file format - ```json - {"type":"speech", "start_time": "2024-02-28T08:18:18.061031795Z", "stop_time":"2024-02-28T08:18:22.401031795Z", "speaker_id": "Sacha_Arbonel", "text": "hello"} - {"type":"speech", "start_time": "2024-02-28T08:18:22.401031795Z", "stop_time":"2024-02-28T08:18:26.741031795Z", "speaker_id": "Sacha_Arbonel", "text": "how are you"} - {"type":"speech", "start_time": "2024-02-28T08:18:26.741031795Z", "stop_time":"2024-02-28T08:18:31.081031795Z", "speaker_id": "Tommaso_Barbugli", "text": "I'm good"} - {"type":"speech", "start_time": "2024-02-28T08:18:31.081031795Z", "stop_time":"2024-02-28T08:18:35.421031795Z", "speaker_id": "Tommaso_Barbugli", "text": "how about you"} - {"type":"speech", "start_time": "2024-02-28T08:18:35.421031795Z", "stop_time":"2024-02-28T08:18:39.761031795Z", "speaker_id": "Sacha_Arbonel", "text": "I'm good too"} - {"type":"speech", "start_time": "2024-02-28T08:18:39.761031795Z", "stop_time":"2024-02-28T08:18:44.101031795Z", "speaker_id": "Tommaso_Barbugli", "text": "that's great"} - {"type":"speech", "start_time": "2024-02-28T08:18:44.101031795Z", "stop_time":"2024-02-28T08:18:48.441031795Z", "speaker_id": "Tommaso_Barbugli", "text": "I'm glad to hear that"} - ``` +```json +{"type":"speech", "start_time": "2024-02-28T08:18:18.061031795Z", "stop_time":"2024-02-28T08:18:22.401031795Z", "speaker_id": "Sacha_Arbonel", "text": "hello"} +{"type":"speech", "start_time": "2024-02-28T08:18:22.401031795Z", "stop_time":"2024-02-28T08:18:26.741031795Z", "speaker_id": "Sacha_Arbonel", "text": "how are you"} +{"type":"speech", "start_time": "2024-02-28T08:18:26.741031795Z", "stop_time":"2024-02-28T08:18:31.081031795Z", "speaker_id": "Tommaso_Barbugli", "text": "I'm good"} +{"type":"speech", "start_time": "2024-02-28T08:18:31.081031795Z", "stop_time":"2024-02-28T08:18:35.421031795Z", "speaker_id": "Tommaso_Barbugli", "text": "how about you"} +{"type":"speech", "start_time": "2024-02-28T08:18:35.421031795Z", "stop_time":"2024-02-28T08:18:39.761031795Z", "speaker_id": "Sacha_Arbonel", "text": "I'm good too"} +{"type":"speech", "start_time": "2024-02-28T08:18:39.761031795Z", "stop_time":"2024-02-28T08:18:44.101031795Z", "speaker_id": "Tommaso_Barbugli", "text": "that's great"} +{"type":"speech", "start_time": "2024-02-28T08:18:44.101031795Z", "stop_time":"2024-02-28T08:18:48.441031795Z", "speaker_id": "Tommaso_Barbugli", "text": "I'm glad to hear that"} +``` ## User Permissions @@ -224,14 +223,74 @@ client.update( ``` - + +```bash +# Disable on call level +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAME}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "transcription": { + "mode": "disabled" + } + } + }' + +# Disable on call type level +curl -X PUT "https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE_NAME}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings": { + "transcription": { + "mode": "disabled" + } + } + }' + +# Enable on call level +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAME}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "transcription": { + "mode": "available" + } + } + }' + +# Other settings +curl -X PATCH "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE_NAME}/${CALL_ID}?api_key=${API_KEY}" \ + -H "Authorization: ${TOKEN}" \ + -H "stream-auth-type: jwt" \ + -H "Content-Type: application/json" \ + -d '{ + "settings_override": { + "transcription": { + "mode": "available", + "audio_only": false, + "quality": "auto_on" + } + } + }' +``` + +By default the transcriptions are stored on Stream’s S3 bucket and retained for 2-weeks. You can also configure your application to have transcriptions stored on your own external storage, see the storage section of tis document for more detail. + + + ## Multi language support When using out of the box, transcriptions are optimized for calls with english speakers. You can configure call transcription to optimize for a different language than english. You can also specify as secondary language as well if you expect to have two languages used simultaneously in the same call. -Please note: the call transcription feature does not perform any language translation. When you select a different language, the trascription process will simply improve the speech-to-text detection for that language. +Please note: the call transcription feature does not perform any language translation. When you select a different language, the trascription process will simply improve the speech-to-text detection for that language. You can set the transcription languages in two ways: either as a call setting or you can provide them to the `StartTranscription` API call. Languages are specified using their international language code (ISO639) Please note: we currently don’t support changing language settings during the call. @@ -269,4 +328,4 @@ Please note: we currently don’t support changing language settings during the - Korean (ko) - Malay (ms) - Norwegian (no) -- Ukrainian (uk) \ No newline at end of file +- Ukrainian (uk)