400 error when using the "List call transcripts" Graph API for MS Teams

Kesavan Kanchi Kandadai 0 Reputation points
2023-02-16T15:27:12.61+00:00

Issue: I am consistently getting a 400 error when using the "List call transcripts" Graph API for MS Teams. Hence, I would like to know if there is any permanent or temporary issue with this API or with the steps I have followed.

Objective: We have created a Teams bot app using the Teams bot framework, which is LIVE & published on Microsoft app source. I am now adding functionality to fetch transcripts for online meetings based on the user ID of the meeting organizer and the meeting ID.

Note: The bot application is developed using node.js.

API reference: Use Graph APIs to fetch transcript - Teams | Microsoft Learn

Steps followed:

  1. RSC permissions for accessing online meeting details and transcripts were added to the Teams bot manifest:

"OnlineMeeting.ReadBasic.Chat", "ChannelMeeting.ReadBasic.Group"

Note: I get an error on sideloading the app package, if I include the following additional permissions, hence the below permissions have not been added as yet.

"OnlineMeetingArtifact.Read.Chat", "ChannelMeetingArtifact.Read.Group".

Additionally, I do not find a way to include the following RSC permissions via the Microsoft app developer portal (https://dev.teams.microsoft.com/), hence included these permissions directly in the registered app in Azure, and provided admin consent via the oAuth URL (step 2).

'OnlineMeetingTranscript.Read.All, OnlineMeetingTranscript.Read.Chat'

  1. Admin approval for RSC permissions required by the app was provided via Teams Admin center (https://admin.teams.microsoft.com/).

In separate testing, the RSC permissions for online meetings were included in the registered app in Axure, and admin approval was granted via the direct oauth URL: https://login.microsoftonline.com/Azure-Tenant-ID/adminconsent?client_id=Azure-Application-Client-ID&state=randomnumber&redirect_uri=https://valid-url-to-be-shown-to-user-on-response

  1. Graph API invocation: The bot app listens to the "meeting end" event, extracts the userId and meetingId, and calls the "List call transcripts" API, as follows:
  async onTurnActivity(context) {
    if (context.activity.type == 'event' && context.activity.name == "application/vnd.microsoft.meetingEnd") {

          // Getting the oauth token using app credentials (APP_CLIENT_ID, CLIENT_SECRET_VALUE) via https://login.microsoftonline.com/{}/oauth2/v2.0/token
          const oAuth_token_data = await getOAuthToken(context.activity.channelData.tenant.id);
          const oAuth_token = oAuth_token_data.access_token;

          const transcriptUrl = `https://graph.microsoft.com/beta/users/${context.activity.from.aadObjectId}/onlineMeetings/${context.activity.channelData.meeting.id}/transcripts`;

          // Request options
          let config = {
            method: 'GET',
            headers: {
                'Authorization': `Bearer ${oAuth_token}`
            },
            url: transcriptUrl
          };

          const response = await axios(config);

Note: The URL invoked looks like this (tried both variations, based on the documentation):

GET https://graph.microsoft.com/beta/users/ba321e0d-79ee-478d-8e28-85a19507f456/onlineMeetings/MSo1N2Y5ZGFjYy03MWJmLTQ3NDMtYjQxMy01M2EdFGkdRWHJlQ/transcripts

GET https://graph.microsoft.com/beta/users(07549e06-69d6-4177-8e62-33563c30f254)/onlineMeetings(MCMxOTpQUlBuOWJVQkhib3lEMFhzRmlBUUhNXzBPSkpHWFEtRXlBR1JXSWQxV

G1rMUB0aHJlYWQudGFjdjIjMTY3NjU1OTI0MDAzOQ==)/transcripts

  1. Receiving 400 error on API invocation: I am not receiving a 401 or 403 error with a proper response JSON, but instead a 400 error. There is no clarity on what the issue is related to; below is a snippet of the response.

Response snippet:

response: {
		status: 400,
		statusText: 'Bad Request',
		headers: {
			'transfer-encoding': 'chunked',
			'content-type': 'application/json',
			'strict-transport-security': 'max-age=31536000',
			'request-id': '5e0d1c1d-ff10-46ef-ad9f-51639895f4cd',
			'client-request-id': '5e0d1c1d-ff10-46ef-ad9f-51639895f4cd',
			'x-ms-ags-diagnostic': '{"ServerInfo":{"DataCenter":"South Central US","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"SN1PEPF000203E5"}}',
			link: '<https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:meetingArtifactExportAPIs&from=2022-10-01&to=2022-11-01>;rel="depreca tion";type="text/html", <https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:meetingArtifactExportAPIs&from=2022-10-01&to=2022-11-01>;r el="deprecation";type="text/html", <https://developer.microsoft-tst.com/en-us/graph/changes?$filterby=beta,PrivatePreview:meetingArtifactExportAPIs&from=2022-10-01&to=20 22-11-01>;rel="deprecation";type="text/html"',
			deprecation: 'Wed, 05 Oct 2022 23:59:59 GMT',
			sunset: 'Sat, 05 Oct 2024 23:59:59 GMT',
			date: 'Wed, 15 Feb 2023 14:12:55 GMT',
			connection: 'close'
		},
		config: {
			transitional: [Object],
			adapter: [Function: httpAdapter],
			transformRequest: [Array],
			transformResponse: [Array],
			timeout: 0,
			xsrfCookieName: 'XSRF-TOKEN',
			xsrfHeaderName: 'X-XSRF-TOKEN',
			maxContentLength: -1,
			maxBodyLength: -1,
			validateStatus: [Function: validateStatus],
			headers: [Object],
			method: 'get',
			url: 'https://graph.microsoft.com/beta/users/07549e06-69d6-4177-8e62-33563c30f254/onlineMeetings/MCMxOTpQUlBuOWJVQkhib3lEMFhzRmlBUUhNXzBPSkpHWFEtRXlBR1JXSWQxVG1rMU B0aHJlYWQudGFjdjIjMTY3NjQ2NTI3OTQzMw==/transcripts',
			data: undefined
		}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,891 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,216 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhanu Kiran 3,606 Reputation points
    2023-03-28T07:13:09.5266667+00:00

    Hello @Kesavan Kanchi Kandadai ,

    Error 400 'Bad Request' is returned when the http request is incorrect or malformed. By looking at the API I see that the online Meeting ID is incorrect and therefore you are receiving 400 Bad Request error.

    Please make sure you are using the right meeting ID. To get Online Meeting ID using graph, refer the following Graph API:

    GET /me/onlineMeetings?$filter=JoinWebUrl eq '{joinWebUrl}'
    GET /users/{userId}/onlineMeetings?$filter=JoinWebUrl eq '{joinWebUrl}'
    

    Please note: joinWebUrl is the meeting URL which can be retrieved using meeting invite. Refer this document for other ways to get online Meeting details.

    Hope this helps.

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

    0 comments No comments

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.