Why is "groupChat" for bots.scopes required for adding app to 1:1 chat?

Dhananjay Ragade 20 Reputation points
2024-08-06T19:48:10.66+00:00

I have a 1:1 chat and am trying to add an app to the chat following https://learn.microsoft.com/en-us/graph/api/chat-post-installedapps?view=graph-rest-1.0&tabs=http#http-request

The chat is a 1:1 chat between two users, and the call to add app to chat is done as one of the users in the chat.

I'm seeing that if I have bots.scopes in the manifest defined as:

  "bots": [
    {
      "scopes": [
        "groupChat", "personal"
      ],

then I am able to successfully add the app to the chat.

However if I remove "groupChat" from the scopes and only have "personal" in the array, then I get a 400 Bad Request:

{
    "error": {
        "code": "BadRequest",
        "message": "BadRequest",
        "innerError": {
            "code": "AppScopeIsNotAllowed",

I removed groupChat from the scopes, got the 400, then put it back and re-uploaded the appPackage.zip to admin.teams, and tried again and then it works.

This seems contrary to the documentation.

Isn't a 1:1 chat "personal" scope and not "groupChat" scope?

When I query out the chat information it is oneOnOne: https://graph.microsoft.com/v1.0/chats/19:35dcf9c1-c733-4d95-8cf4-76c030d6955b_c47e13ed-1fa9-4a40-9f7f-ae6f0c166a95@unq.gbl.spaces?$expand=members

    "chatType": "oneOnOne",
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,355 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,359 questions
0 comments No comments
{count} votes

Accepted answer
  1. Prasad-MSFT 7,056 Reputation points Microsoft Vendor
    2024-08-07T05:51:01.09+00:00

    The 'personal' scope is ideal for scenarios where the bot needs to provide personalized information or services to an individual user. This scope is used for 1:1 chat between a user and a bot or app.

    The 'groupChat' scope is used for group chats involving multiple users and a bot or app. When you add a bot to a chat between two users it becomes a group chat. Hence the 'groupChat' scope is required.


0 additional answers

Sort by: Most helpful

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.