diff --git a/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/README.md b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/README.md new file mode 100644 index 000000000..f0f31e442 --- /dev/null +++ b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/README.md @@ -0,0 +1,2 @@ +# Livechat Audio/Video Calls + diff --git a/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-start-call.md b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-start-call.md new file mode 100644 index 000000000..5778ccba9 --- /dev/null +++ b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-start-call.md @@ -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 +} +``` + diff --git a/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-update-call-status.md b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-update-call-status.md new file mode 100644 index 000000000..01a565556 --- /dev/null +++ b/api/rest-api/endpoints/omnichannel/livechat-endpoints/livechat-audio-video-calls/livechat-update-call-status.md @@ -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 +} +``` +