Teams Extension composeExtensions request payload channelData.team.id not in GUID format

David Chan 6 Reputation points
2024-11-05T04:25:19.8633333+00:00

Hi Everyone,

I am trying to use Graph API to download the message attachment in teams channel.

But we found the channelData.team.id not in GUID format

"team": {

"id": "19:-Ml7DKbJkZVh9gO......cKEwmWw1@thread.tacv2"

}

that we cannot use https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}

to get the message details.

here is the error message

{

    "error": {

        "code": "BadRequest",

        "message": "teamId needs to be a valid GUID.",

        "innerError": {

            "date": "2024-11-05T02:08:41",

            "request-id": "5073d0e3-55aa-4ec8-8405-45455232b4c4",

            "client-request-id": "7100dd6c-673f-368c-df14-afec60b69f49"

        }

    }

}

Will anyone know how to get the GUID by the channelData.team.id?

Or how can we get the message details by the ID?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,284 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,241 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 42,211 Reputation points
    2024-11-05T05:44:27.0366667+00:00

    End this thread, the issue has been resolved.

    Source: https://learn.microsoft.com/en-us/answers/questions/2115460/please-delete.


  2. Hitesh Pachipulusu - MSFT 2,915 Reputation points Microsoft Vendor
    2024-11-05T06:43:18.81+00:00

    Hello David Chan,

    Thank you for contacting Microsoft Support!

    It looks like you're encountering an issue with the teams-id format when trying to use the Graph API to download message attachments in a Teams channel.

    To resolve this, you can use the following steps:

    1. Get the Team's GUID:
      • Use the GET /teams endpoint to list all teams that the user is a member of. This will return the GUIDs for the teams.
      • Example request:
             GET https://graph.microsoft.com/v1.0/me/joinedTeams
        
      • Look for the team with the matching display name or other identifiable information to find the corresponding GUID.
    2. Get the Channel's GUID:
      • Once you have the team's GUID, you can list the channels within that team to get the channel's GUID.
      • Example request:
             GET https://graph.microsoft.com/v1.0/teams/{team-id}/channels
        
    3. Get the Message Details:
      • With the team and channel GUIDs, you can now get the message details using the GET /teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id} endpoint.
      • Example request:
             GET https://graph.microsoft.com/v1.0/teams/{team-id}/channels/{channel-id}/messages/{chatMessage-id}
        

    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.


  3. Tejal patil 0 Reputation points
    2024-11-05T07:39:34.25+00:00

    End this thread, the issue has been resolved.

    0 comments No comments

  4. CarlZhao-MSFT 42,211 Reputation points
    2024-11-05T08:16:32.27+00:00

    Hi @David Chan,

    This id looks like a chat id or a channel id, check if you have passed the channel id to the team id by mistake.

    As the error message says, the team id should be in GUID format. If you don't have the team id stored, you can retrieve it by calling the /teams?$filter=displayName eq '{team name}' API.

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional 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.