-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pbe-5141-rtmp-public-docs' of github.com:GetStream/prot…
…ocol into pbe-5141-rtmp-public-docs
- Loading branch information
Showing
39 changed files
with
13,803 additions
and
3,575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
docusaurus/video/docusaurus/docs/api/_common_/async-tasks.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
<Tabs groupId="examples"> | ||
<TabItem value="js" label="JavaScript"> | ||
|
||
```js | ||
// Example of monitoring the status of an async task | ||
// The logic is same for all async tasks | ||
const response = await client.<async operation>(); | ||
|
||
// you need to poll this endpoint | ||
const taskResponse = await client.getTaskStatus({id: response.task_id}) | ||
|
||
console.log(taskResponse.status === 'completed'); | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="py" label="Python"> | ||
|
||
```py | ||
# Example of monitoring the status of an async task | ||
# The logic is same for all async tasks | ||
response = client.<async operation>() | ||
task_id = response.data.task_id | ||
|
||
# get information about the task | ||
task_status = client.get_task(task_id) | ||
|
||
# just an example, in reality it can take a few seconds for a task to be processed | ||
if task_status.data.status == "completed": | ||
print(task_status.data.result) | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="curl" label="cURL"> | ||
|
||
```bash | ||
# When an operation is async, a task_id will be included in the API response | ||
# That task_id can be used to monitor the status of the task | ||
# When finished, task status will be completed | ||
curl -X GET https://video.stream-io-api.com/api/v2/tasks/${TASK_ID}?api_key=${API_KEY} \ | ||
-H "Authorization: ${TOKEN}" \ | ||
-H "stream-auth-type: jwt" | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
40 changes: 40 additions & 0 deletions
40
docusaurus/video/docusaurus/docs/api/_common_/custom-events.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
<Tabs groupId="examples"> | ||
<TabItem value="js" label="JavaScript"> | ||
|
||
```js | ||
// send a custom event to all users watching the call | ||
call.sendCustomEvent({ | ||
custom: { | ||
'render-animation': 'balloons', | ||
}, | ||
user_id: 'john', | ||
}); | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="py" label="Python"> | ||
|
||
```py | ||
# send a custom event to all users watching the call | ||
call.send_call_event(user_id=user.id, custom={"render-animation": "balloons"}) | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="curl" label="cURL"> | ||
|
||
```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 '{ | ||
"custom": {"render-animation": "balloons"}, | ||
"user_id": "john" | ||
}' | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
docusaurus/video/docusaurus/docs/api/_common_/delete-users.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
import AsyncTasks from '../_common_/async-tasks.mdx'; | ||
|
||
Deleting a user means: | ||
|
||
- the user can't connect to Stream API | ||
- their data won't appear in user queries | ||
|
||
Delete has the following opitions: | ||
|
||
| Name | Type | Description | Optional | | ||
| ---------------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | | ||
| `user` | Enum (soft, pruning, hard) | - Soft: marks user as deleted and retains all user data. <br /> - Pruning: marks user as deleted and nullifies user information. <br /> - 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). <br /> - 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. <br /> - Pruning: marks all user messages as deleted, nullifies message information and removes some message data such as reactions and flags. <br /> - Hard: deletes messages completely with all related information. | Yes | | ||
| `new_channel_owner_id` | string | Channels owned by hard-deleted users will be transferred to this userID. If you doesn't provide a value, the channel owner will have a system generated ID like `delete-user-8219f6578a7395g` | Yes | | ||
| `calls` | Enum (soft, hard) | - Soft: marks calls and related data as deleted. <br /> - Hard: deletes calls and related data completely <br /> Note that this applies only to 1:1 calls, not group calls | Yes | | ||
|
||
<Tabs groupId="examples"> | ||
<TabItem value="js" label="JavaScript"> | ||
|
||
```js | ||
client.deleteUsers({ user_ids: ['<id>'] }); | ||
|
||
//restore | ||
client.restoreUsers({ user_ids: ['<id>'] }); | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="py" label="Python"> | ||
|
||
```py | ||
client.delete_users(user_ids=["<id>"]) | ||
|
||
# restore | ||
client.restore_users(user_ids=["<id>"]) | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="curl" label="cURL"> | ||
|
||
```bash | ||
# 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"] | ||
}' | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
Deleting and restoring users in bulk can take some time, this is how you can check the progress: | ||
|
||
<AsyncTasks /> | ||
|
||
For more informiation, please refer to the [async operations guide](/api/misc/async) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.