How to join a scheduled meeting using Azure bot

Nyan Cat 25 Reputation points
2025-01-20T16:49:26.97+00:00

Hello,

I am trying to join a scheduled call

request_body = Call(
    odata_type="#microsoft.graph.call",
    callback_uri="https://5141-185-249-114-114.ngrok-free.app/callback",
    tenant_id=self.tenant_id,
    # requested_modalities = [
    #     Modality.Audio,
    # ],
    media_config=ServiceHostedMediaConfig(
        odata_type="#microsoft.graph.serviceHostedMediaConfig"
        # pre_fetch_media = [
        #     MediaInfo(
        #         uri = "https://cdn.contoso.com/beep.wav",
        #         resource_id = "f8971b04-b53e-418c-9222-c82ce681a582",
        #     ),
        #     MediaInfo(
        #         uri = "https://cdn.contoso.com/cool.wav",
        #         resource_id = "86dc814b-c172-4428-9112-60f8ecae1edb",
        #     ),
        # ],
    ),
    chat_info = ChatInfo(
        odata_type="#microsoft.graph.chatInfo",
        thread_id="19:meeting_OWI4NGY3NmEtZjU3OC00OGU2LWE0MTMtYWY5NmE0OWIwMjRk@thread.v2",
        message_id="0",
    ),
    meeting_info=OrganizerMeetingInfo(
        odata_type="#microsoft.graph.organizerMeetingInfo",
        organizer=IdentitySet(
            odata_type="#microsoft.graph.identitySet",
            user=Identity(
                odata_type="#microsoft.graph.identity",
                id=user_id,
                display_name="Bob",
                additional_data={
                    "tenant_id": self.tenant_id,
                }
            ),
        ),
        additional_data={
                "allow_conversation_without_host":True,
        }
    ),
)

try:
    response = await self.graph_client.communications.calls.post(request_body)
	print(response)
except Exception as e:
    print(f"Failed to join call: {e}")

the user_id I am using is the user id of the user who scheduled the call. The tenant id is the same tenant id I used when creating credentials for the graph client. I am still getting this error:
error: MainError(additional_data={}, code='7505', details=None, inner_error=InnerError(additional_data={}, client_request_id='b502ccb8-30ce-49f6-8e0c-b984708d6d0b', date=DateTime(2025, 1, 20, 16, 44, 10, tzinfo=Timezone('UTC')), odata_type=None, request_id='11743bf1-d06d-4f97-93a2-fc94f4f6cd10'), message='Request authorization tenant mismatch.', target=None)

I simply want to join the scheduled online call as a bot user and then start the recording.

Microsoft Teams Development
Microsoft Security Microsoft Graph
{count} votes

2 answers

Sort by: Most helpful
  1. Akhil Nasalwai - MSFT 1,685 Reputation points Microsoft External Staff
    2025-01-21T07:10:33.1366667+00:00

    Hello Nyan Cat,

    Thank you for contacting Microsoft!

    Regarding the error Request authorization tenant mismatch, please verify the tenant id once again which is used while creating credentials. Also please verify the request body as per the documentation mentioned below:

    Link: Join a scheduled meeting

    User's image

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


  2. Nivedipa-MSFT 3,646 Reputation points Microsoft External Staff Moderator
    2025-01-24T04:10:55.39+00:00

    @Nyan Cat - It seems you're facing a "Request authorization tenant mismatch" error. This usually indicates that the tenant ID used for authorization doesn't match the tenant ID of the resource you're trying to access.

    Here are some steps to troubleshoot and resolve the issue:

    Verify Tenant ID: Ensure that the tenant_id in your request matches the tenant ID of the user who scheduled the call. Double-check for any typos or mismatches.

    Check User ID: Confirm that the user_id you're using is correct and belongs to the user who scheduled the call.

    Permissions: Ensure that the application has the necessary permissions to join the call. You might need to grant additional permissions in the Azure portal.

    Callback URI: Verify that the callback_uri is correctly configured and accessible.

    Token Scope: Check that the token you're using has the correct scope for the operation you're trying to perform. The token should be issued for the correct tenant.

    Thanks, 
    Nivedipa

     
    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.