Skip to content

Commit

Permalink
Add and update cURL examples
Browse files Browse the repository at this point in the history
  • Loading branch information
szuperaz committed May 13, 2024
1 parent 2f9d785 commit fe9c7de
Show file tree
Hide file tree
Showing 21 changed files with 1,313 additions and 96 deletions.
5 changes: 2 additions & 3 deletions docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ call.start_hls_broadcasting()
<TabItem value="curl" label="cURL">

```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" \
curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/start_broadcasting?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt"
```

Expand Down
27 changes: 14 additions & 13 deletions docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,20 @@ call.create(
<TabItem value="curl" label="cURL">

```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": "[email protected]",
"members": [
{ "role": "speaker", "user_id": "[email protected]" }
],
"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": "[email protected]",
"members": [
{ "role": "admin", "user_id": "[email protected]" }
],
"custom": { "color": "blue" }
}
}'
```

</TabItem>
Expand Down
17 changes: 17 additions & 0 deletions docusaurus/video/docusaurus/docs/api/_common_/go_live.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,22 @@ call.goLive({ start_hls: true, start_recording: true });
call.go_live(start_hls=True, start_recording=True)
```

</TabItem>

<TabItem value="curl" label="cURL">

```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 }'
```

</TabItem>
</Tabs>
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,17 @@ call.update_call_members(
<TabItem value="curl" label="cURL">

```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" }
]
}'
```

</TabItem>
Expand All @@ -68,5 +69,18 @@ call.updateCallMembers({
call.update_call_members(remove_members=["jack", "sara"])
```

</TabItem>
<TabItem value="curl" label="cURL">

```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"]
}'
```

</TabItem>
</Tabs>
12 changes: 12 additions & 0 deletions docusaurus/video/docusaurus/docs/api/_common_/rtmp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,17 @@ rtmp_url = response.data.call.ingress.rtmp.address
print(rtmp_url, stream_key)
```

</TabItem>
<TabItem value="curl" label="cURL">

```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
```

</TabItem>
</Tabs>
18 changes: 9 additions & 9 deletions docusaurus/video/docusaurus/docs/api/_common_/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ client.video.update_call_type(name='allhands', 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 '{
Expand All @@ -84,8 +84,8 @@ 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}" \
curl -X PUT https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \
-H "Authorization: ${TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
Expand Down Expand Up @@ -142,17 +142,17 @@ call.start_recording(recording_external_storage="my-storage")

```bash
# update the call type to use Stream S3 storage for recordings
curl -X PUT https://video.stream-io-api.com/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" \
curl -X PUT https://video.stream-io-api.com/api/v2/video/calltypes/${CALL_TYPE}?api_key=${API_KEY} \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt" \
-H 'Content-Type: application/json' \
-d '{
"external_storage": "my-first-storage"
}'

# 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}" \
curl -X POST "https://video.stream-io-api.com/api/v2/video/call/${CALL_TYPE}/${CALL_ID}/start_transcription?api_key=${API_KEY}" \
-H "Authorization: ${TOKEN}" \
-H "stream-auth-type: jwt" \
-H 'Content-Type: application/json' \
-d '{
Expand Down Expand Up @@ -252,7 +252,7 @@ client.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 '{
Expand Down Expand Up @@ -334,7 +334,7 @@ client.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 '{
Expand Down
21 changes: 11 additions & 10 deletions docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,18 @@ call.update(
<TabItem value="curl" label="cURL">

```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"
}
}'
}
}'
```

</TabItem>
Expand Down
Loading

0 comments on commit fe9c7de

Please sign in to comment.