> For the complete documentation index, see [llms.txt](https://docs.ggwp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ggwp.com/ggwp-client-sdk/additional-supported-integrations/voice-vivox/integrating-with-unity-ssr.md).

# Integrating with Unity SSR

## Overview

Please [refer here](/ggwp-client-sdk/additional-supported-integrations/voice-vivox/vivox-unity-ssr-vs-ggwp-sdk.md) for the general integration flow with Unity SSR + GGWP.

Here are a few relevant links from Unity's documentation regarding SSR:

* [Server-side recording](https://docs.unity.com/ugs/en-us/manual/vivox-unity/manual/Unity/server-side-recording/ssr-overview)
* [Developer documentation](https://docs.vivox.com/v5/general/core/5_19_0/en-us/Default.htm#Core/developer-guide/server-side-recording/ssr-overview.htm)
* [Unity Services Web API docs](https://services.docs.unity.com/ssr/v2/)

## API Requirements

Vivox recordings must be triggered through SSR API calls. This can be done at a fixed frequency during voice sessions in your game or at an event like the end of a match. Please contact your Vivox rep for help with setting up the correct SSR trigger strategy given your moderation goals.

The following inputs are required to make the SSR API call:

<table><thead><tr><th width="122.23828125">Credential</th><th>Source</th><th>Purpose</th></tr></thead><tbody><tr><td>Organization ID</td><td>Unity dashboard → Vivox → Config page</td><td>Organization ID associated to your game</td></tr><tr><td>Project ID</td><td>Same as above.</td><td>Project ID allocated to your game</td></tr><tr><td>Access token</td><td>Same as above.</td><td>Shared secret used to sign JWTs</td></tr><tr><td>Channel Session ID</td><td>Get this at runtime when a user joins a channel</td><td>Used to target a specific session to record</td></tr><tr><td>AWS access key</td><td>To be provided by GGWP</td><td>Access S3 bucket for storage</td></tr><tr><td>AWS secret</td><td>To be provided by GGWP</td><td>Access S3 bucket for storage</td></tr><tr><td>S3 Bucket  Name</td><td>To be provided by GGWP</td><td>To store the voice recording</td></tr></tbody></table>

## Sample script to trigger SSR

This script triggers recording for last 15min of voice data.

```python
import requests

ORG_ID = "UNITY_ORG_ID"
PROJECT_ID = "UNITY_PROJECT_ID"
ACCESS_TOKEN = "UNITY_ACCESS_TOKEN"
CHANNEL_SESSION_ID = "UNITY_SOMETHING_LIKE_sip:confctl-g-xxxx@mtu1xp.vivox.com"
ACCESS_KEY_ID = "GGWP_AWS_KEY"
SECRET_KEY = "GGWP_AWS_SECRET"

# AWS S3 setup
S3_BUCKET = "GGWP_BUCKET"

url = f"https://vivox.services.api.unity.com/ssr/v2/organizations/{ORG_ID}/projects/{PROJECT_ID}/monitor"

headers = {
    "Authorization": f"Basic {ACCESS_TOKEN}",
    "Content-Type": "application/json"
}

payload = {
  "targetUri": CHANNEL_SESSION_ID,
  "history": 15,
  "callbackUrl": "https://something.somthing",
  "callbackKey": "test-123",
  "storageOptions": {
    "provider": "aws",
    "credentials": {
      "bucket": S3_BUCKET,
      "accessKeyId": ACCESS_KEY_ID,
      "secretAccessKey": SECRET_KEY
    }
  }
}

response = requests.post(url, json=payload, headers=headers)

if response.status_code == 202:
    print("✅ SSR started successfully.")
    print(response.json())
else:
    print(f"❌ Failed to start SSR: {response.status_code}")
    print(response.text)
```
