Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Livechat Audio/Video Calls

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
description: Starts a webrtc audio/video call.
---

# Livechat Initiate Audio/Video Calls

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `api/v1/livechat/webrtc.call` | `YES` | `GET` |

## Headers

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) |
| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) |

## Query Variables

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `rid` | `zRAeTszXor8CCPceB` | Required | The room `_id`. |

## Example Call

```bash
curl --location --request GET 'http://localhost:3000/api/v1/livechat/webrtc.call?rid=123abcxyz123\
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name'
```

## Result

```javascript
{
"videoCall": {
"rid": "123abcxyz123",
"provider": "webrtc",
"callStatus": "ringing"
},
"success": true
}
```

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
description: Update call status of an existing webrtc audio/video call.
---

# Livechat Update Audio/Video Call Status

| URL | Requires Auth | HTTP Method |
| :--- | :--- | :--- |
| `api/v1/livechat/webrtc.call/:callId` | `YES` | `PUT` |

## Headers

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `X-User-Id` | `myuser-name` | Required | Your username hash \(returned after you log in through the API\) |
| `X-Auth-Token` | `myauth-token` | Required | Your token \(returned after you log in through the API\) |

## Path Variables

| Argument | Example | Required | Description |
| :--- | :--- | :--- | :--- |
| `callId` | `zRAeTszXor8CCPceB` | Required | The call message `_id`. |

## Example Payload

```javascript
{
rid: 'abc123xyzabc',
status: 'ended'
}
```

## Example Call

```bash
curl --location --request GET 'http://localhost:3000/api/v1/livechat/webrtc.call/zRAeTszXor8CCPceB\
--header 'X-Auth-Token: myauth-token' \
--header 'X-User-Id: myuser-name' \
-d '{ "rid": "abc123xyzabc", "status": "ended" }'
```

## Result

```javascript
{
"status": "ended",
"success": true
}
```