Cannot Start Audio Recording Locally, role 1 and I have rercording _token

SDK Version and Repo I used for testing.
zoom-meeting-sdk-linux_x86_64-6.3.10.7580.tar.xz
meetingsdk-linux-raw-recording-sample

Description
I am trying to save the recording locally with pcm. I tried changing the meetingId to int type and changed the role to 0 to 1 and also made the bot a host manualy within the meeting.

Error?

Log errors:

Error occurred subscribing to audio: 32
Is host now…
CanStartRawRecording result: 2
Cannot start raw recording: no permissions yet, need host, co-host, or recording privilege

How To Reproduce
Just ran the Repo with tokens from the server-to-server sample and the recording token.

My Config.txt

meeting_number: “85797089388”
token: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBLZXkiOiJHNkd5eUlfclNvcWd0STNxb3UwcGciLCJzZGtLZXkiOiJHNkd5eUlfclNvcWd0STNxb3UwcGciLCJtbiI6ODU3OTcwODkzODgsInJvbGUiOjEsImlhdCI6MTc0MDk2MzM0OCwiZXhwIjoxNzQwOTY2OTQ4LCJ0b2tlbkV4cCI6MTc0MDk2Njk0OH0.GNBybzSsdYcEi0JM8_cHM1XPjyjkp6Yt5rStKMt94HY”
meeting_password: “XvM1XbAPGojO3wbJFBZUOsP8tAzMy0.1”
recording_token: “lr8nfs6gt”
GetVideoRawData: “true”
GetAudioRawData: “true”
SendVideoRawData: “false”
SendAudioRawData: “false”

Hey John,

How are you creating the recording_token that you’re passing to the bot in your config.txt? It looks like this token may be incorrect, which may be causing issues when the bot tries to record this meeting. It’s also worth noting that if you change the role back to 0 and exclude the recording token, you should be able to invite the bot to a call where you’re the host. It will request recording permission, and once granted, the bot will start recording the call.

Another alternative would be to use the Recall.ai API. It’s a simple 3rd party API for meetings bots that allows you to get raw video/audio and other data in just a few lines of code.

Let me know if you have any questions!

Hey Amanda,

Thank you for getting back to me. Since this is an upcoming project and I wanted to get a head start!

The recording_token I pass to my config.txt comes from this endpoint:
https://api.zoom.us/v2/meetings/{meeting_id}/jointoken/local_recording.
I retrieve it using a simple Python script, which I’ve included below:

edit:
The following .env vars I used came from the server to server app I created:

ACCOUNT_ID=****************** (22 chars)
CLIENT_ID=****************** (22 chars)
CLIENT_SECRET=************************ (32 chars)

edit:
And here the auth url i used in the code:

OAUTH_TOKEN_URL=https://zoom.us/oauth/token
@app.route('/get-recording-token', methods=['POST'])
def get_recording_token():
    try:
        data = request.json
        meeting_id = data.get('meetingId')
        
        if not meeting_id:
            return jsonify({"error": "Meeting ID is required"}), 400
        
        access_token = get_oauth_token()
        
        recording_token = get_local_recording_token(access_token, meeting_id)
        
        return jsonify({"recordingToken": recording_token})
    
    except Exception as e:
        return jsonify({"error": str(e)}), 500

def get_oauth_token():
    """Get OAuth access token using Server-to-Server credentials"""


    CLIENT_ID = os.getenv("CLIENT_ID")
    CLIENT_SECRET = os.getenv("CLIENT_SECRET")
    ACCOUNT_ID = os.getenv("ACCOUNT_ID")
    url = os.getenv("OAUTH_TOKEN_URL")
    
    auth_string = f"{CLIENT_ID}:{CLIENT_SECRET}"
    encoded_auth = base64.b64encode(auth_string.encode()).decode()
    
    headers = {
        "Authorization": f"Basic {encoded_auth}",
        "Content-Type": "application/x-www-form-urlencoded"
    }
    
    data = {
        "grant_type": "account_credentials",
        "account_id": ACCOUNT_ID
    }
    
    response = requests.post(url, headers=headers, data=data)
    
    if response.status_code != 200:
        raise Exception(f"Failed to get OAuth token: {response.text}")
    
    print(response.json())
    
    return response.json()["access_token"]

def get_local_recording_token(access_token, meeting_id):
    """Get local recording token for a specific meeting"""
    url = f"https://api.zoom.us/v2/meetings/{meeting_id}/jointoken/local_recording"
    
    headers = {
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json"
    }
    
    response = requests.get(url, headers=headers)
    
    if response.status_code != 200:
        raise Exception(f"Failed to get recording token: {response.text}")
    
    return response.json()["token"]

Hi @John_Carlo,

Thanks for sharing the code sample. I reviewed it, and since you’re not getting explicit errors from the Zoom API, it’s tough to pinpoint the issue. It looks like you’ve followed the Zoom OAuth guide correctly though

One possibility: the meeting host may not have granted OAuth access to your app. OAuth can only auto-start audio recording if the host explicitly authorized it. You could double check this and see if this is the issue