Join external meetings as a bot (OBF)

View as Markdown

Bots and other non-human users can use the Meeting SDK to join meetings with an On Behalf of (OBF) token that associates them with the account owner who authorized them. For example, someone might use OAuth to connect an AI Notetaker app from the Zoom App Marketplace to their Zoom account, authorizing it to join their meetings as a companion using the Meeting SDK.

  1. Implement an OAuth flow and request an access token. Use this access token to authorize subsequent API requests.

  2. Use the Users API to get an OBF token. When you use this API, tokens expire after 2 hours.

    You can also set a custom time to live (TTL) for the token, up to a maximum of one year. It's a best practice to get the OBF token right before you start the meeting.

    Endpoint: GET https://api.zoom.us/v2/users/{userId}/token?type=onbehalf

    Request Header:

    {
        "Authorization": "Bearer {{ACCESS_TOKEN}}"
    }
    

    Response Code: 200 OK

    Response Body:

    {
        "token": "{{OBF_TOKEN}}"
    }
    
  3. Pass the OBF token to the Meeting SDK to start the Zoom user's meeting or webinar. OBF apps can only join a meeting once their verified associated owner is in a meeting or webinar, and must leave a meeting or webinar when their owner leaves.

    private fun startMeeting(obf: String) {
    val meetingService = ZoomSDK.getInstance().meetingService
    val startParams = StartMeetingParamsWithoutLogin().apply {
        onBehalfToken = obf
        meetingNo = ""
    }
    meetingService.addListener(meetingServiceListener)
    val result = meetingService.startMeetingWithParams(this, startParams, StartMeetingOptions())
    if (result == MeetingError.MEETING_ERROR_SUCCESS) {
        // The SDK will attempt to join the meeting.
    }
    }