Skip to content

Commit

Permalink
improve curl examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tbarbugli committed May 9, 2024
1 parent 9597abc commit 8318638
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 114 deletions.
5 changes: 3 additions & 2 deletions docusaurus/video/docusaurus/docs/api/_common_/broadcast.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ 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 "stream-auth-type: jwt"
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt"
```

</TabItem>
Expand Down
24 changes: 12 additions & 12 deletions docusaurus/video/docusaurus/docs/api/_common_/create-call.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,18 @@ call.create(

```bash
curl -X POST "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}?api_key=${API_KEY}" \
-H "Content-Type: application/json" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt" \
-d '{
"data": {
"created_by_id": "[email protected]",
"members": [
{ "role": "speaker", "user_id": "[email protected]" }
],
"custom": { "color": "blue" }
}
}'
-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" }
}
}'
```

</TabItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ 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 "Content-Type: application/json" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt" \
-d '{
"update_members": [
{ "user_id": "sara" },
{ "user_id": "emily", "role": "admin" }
]
}'
-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" }
]
}'
```

</TabItem>
Expand Down
21 changes: 10 additions & 11 deletions docusaurus/video/docusaurus/docs/api/_common_/update-call.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ call.update(

```bash
curl -X PUT "https://video.stream-io-api.com/video/call/default/${CALL_ID}?api_key=${API_KEY}" \
-H "Content-Type: application/json" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt" \
-d '{
"settings_override": {
"audio": {
"mic_default_on": true
}
}
}'

-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"settings_override": {
"audio": {
"mic_default_on": true
}
}
}'
```

</TabItem>
Expand Down
18 changes: 10 additions & 8 deletions docusaurus/video/docusaurus/docs/api/recording/recording_calls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,14 @@ 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 "stream-auth-type: jwt"
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-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 "stream-auth-type: jwt"
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt"
```

</TabItem>
Expand Down Expand Up @@ -78,9 +80,9 @@ call.list_recordings()
<TabItem value="curl" label="cURL">

```bash
curl -X GET "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/recordings?api_key=${API_KEY}" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt"
curl "https://video.stream-io-api.com/video/call/${CALL_TYPE}/${CALL_ID}/recordings?api_key=${API_KEY}" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt"
```

</TabItem>
Expand Down Expand Up @@ -305,7 +307,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',
Expand Down
86 changes: 48 additions & 38 deletions docusaurus/video/docusaurus/docs/api/recording/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -84,31 +84,36 @@ 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 "stream-auth-type: jwt" \
-d '{
"name": "my-storage",
"storage_type": "s3",
"bucket": "my-bucket",
"custom_folder": "my-folder",
"aws_s3": {
"s3_region": "us-east-1",
"s3_api_key": "my-api-key",
"s3_secret": "my-secret"
}
}'
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"name": "my-storage",
"storage_type": "s3",
"bucket": "my-bucket",
"custom_folder": "my-folder",
"aws_s3": {
"s3_region": "us-east-1",
"s3_api_key": "my-api-key",
"s3_secret": "my-secret"
}
}'

curl -X PATCH https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
"external_storage": "my-storage"
}'
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"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 "stream-auth-type: jwt" \
-d '{
"recording_external_storage": "my-storage"
}'
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"recording_external_storage": "my-storage"
}'
```

</TabItem>
Expand Down Expand Up @@ -161,17 +166,20 @@ 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 "stream-auth-type: jwt" \
-d '{
"external_storage": "my-first-storage"
}'
-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 "stream-auth-type: jwt" \
-d '{
"recording_external_storage": "my-second-storage"
}'
-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"recording_external_storage": "my-second-storage"
}'
```

</TabItem>
Expand Down Expand Up @@ -271,14 +279,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 "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: ${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"
}'
```

</TabItem>
Expand Down
73 changes: 43 additions & 30 deletions docusaurus/video/docusaurus/docs/api/transcription/storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,33 +80,40 @@ call.start_transcription(transcription_external_storage= "my-s3")
<TabItem value="curl" label="cURL">

```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 "stream-auth-type: jwt" \
-d '{
"name": "my-storage",
"storage_type": "s3",
"bucket": "my-bucket",
"custom_folder": "my-folder",
"aws_s3": {
"s3_region": "us-east-1",
"s3_api_key": "my-api-key",
"s3_secret": "my-secret"
}
}'

-H "Authorization: ${JWT_TOKEN}" \
-H "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"name": "my-storage",
"storage_type": "s3",
"bucket": "my-bucket",
"custom_folder": "my-folder",
"aws_s3": {
"s3_region": "us-east-1",
"s3_api_key": "my-api-key",
"s3_secret": "my-secret"
}
}'

curl -X PATCH https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \
-H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt" \
-d '{
"external_storage": "my-storage"
}'
# 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 "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"external_storage": "my-storage"
}'

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 "stream-auth-type: jwt" \
-d '{
"transcription_external_storage": "my-storage"
}'
# 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 "Content-Type: application/json" \
-H "stream-auth-type: jwt" \
-d '{
"transcription_external_storage": "my-storage"
}'
```

</TabItem>
Expand Down Expand Up @@ -136,7 +143,7 @@ await serverSideClient.updateCallType('my-call-type', {
external_storage: "stream-s3",
});

// 2. specify Stream S3 storage when starting call transcribing
// 2. specify Stream S3 storage when starting call transcribing
await call.startTranscription({
transcription_external_storage: "my-storage",
});
Expand All @@ -157,16 +164,20 @@ call.start_transcription(transcription_external_storage="my-storage")
<TabItem value="curl" label="cURL">

```bash

curl -X PATCH https://video.stream-io-api.com/video/call_types/${CALL_TYPE_ID}?api_key=${API_KEY} \
# 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 "stream-auth-type: jwt" \
-H 'Content-Type: application/json' \
-d '{
"external_storage": "my-first-storage"
}'

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 "stream-auth-type: jwt" \
# 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 "stream-auth-type: jwt" \
-H 'Content-Type: application/json' \
-d '{
"transcription_external_storage": "my-second-storage"
}'
Expand Down Expand Up @@ -269,7 +280,9 @@ 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 "stream-auth-type: jwt" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt" \
-H 'Content-Type: application/json' \
-d '{
"name": "my-storage",
"storage_type": "gcs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,15 @@ call.stop_transcription()
<TabItem value="curl" label="cURL">

```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 "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 "stream-auth-type: jwt"
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 "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 "stream-auth-type: jwt"
```

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.
Expand Down Expand Up @@ -76,7 +82,9 @@ call.list_transcriptions()
<TabItem value="curl" label="cURL">

```bash
curl -X GET "https://video.stream-io-api.com/video/call/default/${CALL_ID}/transcriptions?api_key=${API_KEY}" -H "Authorization: ${JWT_TOKEN}" -H "stream-auth-type: jwt"
curl "https://video.stream-io-api.com/video/call/default/${CALL_ID}/transcriptions?api_key=${API_KEY}" \
-H "Authorization: ${JWT_TOKEN}" \
-H "stream-auth-type: jwt"
```

</TabItem>
Expand Down

0 comments on commit 8318638

Please sign in to comment.