> ## Documentation Index
> Fetch the complete documentation index at: https://docs.argalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Meet

> Fetch a seeded meeting transcript from a Google Calendar event using Google Meet and Workspace twins

Use the Google Meet twin to test conference and transcript reads through the Google Meet REST v2 API. Provision `google_calendar` and `google_meet` in the same Twin Run to resolve Calendar meeting links. Add `google_workspace` to use its Directory identities and scoped tokens.

Transcript text and speaker data come from fixtures. A Calendar event with a Meet link gives you a meeting space. Seed a conference and transcript to test retrieval after the call.

## Start with a completed meeting

Save this [Scenario](https://docs.argalabs.com/twins/seeding.md) as `meet-transcript.json`. It links a Calendar event to a Meet conference by event ID. The fixed clock starts after the transcript becomes available.

```json theme={null}
{
  "name": "Calendar meeting transcript",
  "twins": ["google_workspace", "google_calendar", "google_meet"],
  "seed_config": {
    "google_workspace": {
      "directory": {
        "customer": {"customerDomain": "meet.example.test"},
        "users": [
          {
            "primaryEmail": "organizer@meet.example.test",
            "isAdmin": true,
            "name": {"givenName": "Ada", "familyName": "Rao"}
          },
          {
            "primaryEmail": "speaker@meet.example.test",
            "name": {"givenName": "Sam", "familyName": "Lee"}
          }
        ]
      }
    },
    "google_calendar": {
      "email": "organizer@meet.example.test",
      "base_time": "2030-01-15T17:35:00Z",
      "calendars": [{
        "name": "Work",
        "events": [{
          "id": "meetdemo01",
          "summary": "Customer sync",
          "start": "2030-01-15T17:00:00Z",
          "end": "2030-01-15T17:30:00Z",
          "attendees": [{"email": "speaker@meet.example.test"}],
          "conferenceData": {
            "createRequest": {
              "requestId": "customer-sync-meet",
              "conferenceSolutionKey": {"type": "hangoutsMeet"}
            }
          }
        }]
      }]
    },
    "google_meet": {
      "base_time": "2030-01-15T17:35:00Z",
      "conferences": [{
        "event_id": "meetdemo01",
        "transcripts": [{
          "id": "customer-sync-transcript",
          "available_time": "2030-01-15T17:31:00Z",
          "entries": [{
            "speaker_email": "speaker@meet.example.test",
            "language_code": "en-US",
            "text": "We will send the revised estimate on Thursday."
          }]
        }]
      }]
    }
  }
}
```

Import the Scenario and use the returned Scenario ID. The examples use `jq` and `curl`. Keep the run output private because it contains credentials.

```bash theme={null}
SCENARIO_ID=$(arga test-runner scenarios import --file meet-transcript.json --json | jq -er '.id')

umask 077
arga twin-runs create --twins google_workspace,google_calendar,google_meet \
  --scenario-id "$SCENARIO_ID" --ttl 60 --wait --json > run.json
```

## Fetch the transcript

Wait until [the run is ready](https://docs.argalabs.com/api-reference/get-get-twin-provision-status.md). Point your app’s Meet client at the returned `GOOGLE_MEET_API_BASE_URL`. The example uses the returned Calendar and Meet base URLs and their bearer tokens. With Workspace Directory enabled, the Meet caller needs `https://www.googleapis.com/auth/meetings.space.readonly` and must be the organizer or a simulated participant. A Calendar invitation alone does not grant transcript access.

```bash theme={null}
CALENDAR_URL=$(jq -er '.twins.google_calendar.base_url' run.json)
CALENDAR_TOKEN=$(jq -er '.twins.google_calendar.env_vars.GOOGLE_CALENDAR_ACCESS_TOKEN' run.json)
MEET_URL=$(jq -er '.twins.google_meet.base_url' run.json)
MEET_TOKEN=$(jq -er '.twins.google_meet.env_vars.GOOGLE_MEET_ACCESS_TOKEN' run.json)

# Read the meeting code from the Calendar event.
MEETING_CODE=$(curl -fsS -H "Authorization: Bearer $CALENDAR_TOKEN" \
  "$CALENDAR_URL/calendar/v3/calendars/primary/events/meetdemo01" |
  jq -er '.conferenceData.conferenceId')

# Find the call for that code.
CONFERENCE=$(curl -fsSG -H "Authorization: Bearer $MEET_TOKEN" \
  --data-urlencode "filter=space.meeting_code = \"$MEETING_CODE\"" \
  "$MEET_URL/v2/conferenceRecords" | jq -er '.conferenceRecords[0].name')

# Find the ready transcript and read its speaker-attributed entries.
TRANSCRIPT=$(curl -fsS -H "Authorization: Bearer $MEET_TOKEN" \
  "$MEET_URL/v2/$CONFERENCE/transcripts" |
  jq -er '.transcripts[] | select(.state == "FILE_GENERATED") | .name')

curl -fsS -H "Authorization: Bearer $MEET_TOKEN" \
  "$MEET_URL/v2/$TRANSCRIPT/entries" |
  jq '.transcriptEntries[] | {participant, text, languageCode}'
```

* If you have the Calendar event’s `hangoutLink`, use its final path segment as the meeting code. Call `GET /v2/spaces/{meetingCode}` to inspect the space.
* For recurring meetings, include a `start_time` filter when listing conference records to select the occurrence you want. Pass a returned `nextPageToken` as `pageToken` to continue a list.
* Each entry’s `participant` is a resource name. Call `GET /v2/{participant}` to look up the speaker, or open the Meet twin URL, enter your Meet token, and browse the conference in the browser.

See Google’s [conference record list reference](https://developers.google.com/workspace/meet/api/reference/rest/v2/conferenceRecords/list) and [artifact guide](https://developers.google.com/workspace/meet/api/guides/artifacts).

## Test a Calendar event your app creates

1. Insert a timed event with `conferenceDataVersion=1` and `conferenceData.createRequest`. Supply a unique `requestId` and set `conferenceSolutionKey.type` to `hangoutsMeet`. See [Google Calendar event creation](https://developers.google.com/workspace/calendar/api/guides/create-events).
2. Use `POST /admin/meet/conferenceRecords` on the Meet twin’s authenticated `admin_url` to seed a conference for the returned event ID. Use one object from `seed_config.google_meet.conferences` in the example. Set `event_id` to the returned ID and omit `available_time` to publish at the end of your event.
3. Once the transcript reaches `FILE_GENERATED`, read the entries from the Meet twin’s `base_url`. To simulate elapsed time, use `POST /admin/clock/advance` on the authenticated admin URL with a body such as `{"seconds":60}`.

Arga’s [twin status response](https://docs.argalabs.com/api-reference/get-get-twin-provision-status.md) returns `admin_url` and `proxy_token`. Send the proxy token as the `arga_env_proxy_token` cookie on admin requests and send the Meet bearer token on provider API requests.

## Seed fields and timing

| Field in `seed_config.google_meet` | Description |
| - | - |
| `base_time` | Optional fixed run clock in RFC 3339 format. Omit it to use the current time. |
| `conferences[].event_id` | Calendar event ID. Use `calendar_id` as well if the same event ID exists on multiple calendars. |
| `conferences[].start_time`, `end_time` | Override the linked Calendar event’s default conference times. |
| `conferences[].participant_emails` | Simulated participants who can read the transcript. The organizer and speakers in transcript entries count as participants. |
| `conferences[].transcripts[].available_time` | When the artifact becomes available. Defaults to the end of the conference. |
| `conferences[].transcripts[].entries` | Spoken text, speaker email, and optional language and timestamps. |

For a standalone Meet Scenario, supply `meeting_code`, `organizer_email`, `start_time`, and `end_time` on the conference fixture. Conference records and transcript entries expire 30 days after the call ends on the twin clock.

When you finish, tear down the Twin Run.

```bash theme={null}
arga twin-runs teardown "$(jq -er '.run_id' run.json)"
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.