diff --git a/docusaurus/video/docusaurus/docs/api/webhooks/overview.mdx b/docusaurus/video/docusaurus/docs/api/webhooks/overview.mdx index 6cd5ca93..e06496b0 100644 --- a/docusaurus/video/docusaurus/docs/api/webhooks/overview.mdx +++ b/docusaurus/video/docusaurus/docs/api/webhooks/overview.mdx @@ -18,7 +18,12 @@ Client-side you can observe calls and receive events by passing the `watch:true` ```js // send a custom event to all users watching the call -TODO +call.sendCustomEvent({ + custom: { + 'render-animation': 'balloons', + }, + user_id: 'john', +}); ``` @@ -33,13 +38,19 @@ call.send_call_event(user_id=user.id, custom={"render-animation": "balloons"}) ```bash -TODO +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" + }' ``` - You can configure your Stream app to send events to your HTTP/webhook and/or to your AWS SQS queue. Webhooks are usually the simplest way to receive events from your app and to perform additional action based on what happens to your application. @@ -58,7 +69,7 @@ Your webhook handler can use the `type` field to handle events based correctly b All webhook requests contain these headers: | Name | Description | -|-------------------|----------------------------------------------------------------------------------------------------------------------| +| ----------------- | -------------------------------------------------------------------------------------------------------------------- | | X-WEBHOOK-ID | Unique ID of the webhook call. This value is consistent between retries and could be used to deduplicate retry calls | | X-WEBHOOK-ATTEMPT | Number of webhook request attempt starting from 1 | | X-API-KEY | Your application’s API key. Should be used to validate request signature | @@ -83,4 +94,3 @@ In case of the request failure Stream Chat attempts to retry a request. The amou - Request timeout: 3 attempts The timeout of one request is 6 seconds, and the request with all retries cannot exceed the duration of 15 seconds. -