Skip to main content

O365 Teams (Using Graph API)

This Integration is part of the MicrosoftGraphTeams Pack.#

Supported versions

Supported Cortex XSOAR versions: 6.0.0 and later.

Microsoft Graph lets your app get authorized access to a user's Teams app in a personal or organization account.

Configure O365 Teams (Using Graph API) on Cortex XSOAR#

  1. Navigate to Settings > Integrations > Servers & Services.

  2. Search for O365 Teams (Using Graph API).

  3. Click Add instance to create and configure a new integration instance.

    ParameterDescriptionRequired
    Server URLTrue
    Tenant IDToken or Tenant ID - see Detailed Instructions (?)True
    Client IDID or Client ID - see Detailed Instructions (?)True
    Client SecretKey or Client Secret - see Detailed Instructions (?)False
    Certificate ThumbprintUsed for certificate authentication. As appears in the "Certificates & secrets" page of the app.False
    Private KeyUsed for certificate authentication. The private key of the registered certificate.False
    Use a self deployed Azure ApplicationFalse
    Application redirect URI (for Authorization Code flow mode)False
    Authorization CodeAuthorization code on behalf of a user, used with self deployed Azure Applications.False
    Email address of the XSOAR delegated Teams user (e.g. "example@demisto.com")True
    Trust any certificate (not secure)False
    Use system proxy settingsFalse
    Suppress Errors for Non Found UsersFalse
  4. Click Test to validate the URLs, token, and connection.

Required Permissions#

Chat.Create - Delegated Chat.Read - Delegated Chat.ReadBasic - Delegated Chat.ReadWrite - Delegated ChatMember.Read - Delegated ChatMember.ReadWrite - Delegated ChatMessage.Read - Delegated ChatMessage.Send - Delegated

Commands#

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.

msgraph-teams-list-chats#


Retrieve the list of chats that the user is part of.

Base Command#

msgraph-teams-list-chats

Input#

Argument NameDescriptionRequired
user_idUser ID to use Teams as (can be principal ID (email address)).Optional
odataAn OData query. See README for OData usage examples.Optional
limitLimit chats to fetch in one request. Default is 20.Optional

Context Output#

PathTypeDescription
MSGraphTeamsChat.IDStringThe ID of the chat.
MSGraphTeamsChat.UserIDStringThe ID of the user.
MSGraphTeamsChat.SubjectStringThe title of the chat.
MSGraphTeamsChat.CreatedDateThe time the chat was created.
MSGraphTeamsChat.LastUpdatedTimeDateThe time the chat was last updated.
MSGraphTeamsChat.TypeStringThe type of chat.

msgraph-teams-create-chat#


Create a new chat.

Base Command#

msgraph-teams-create-chat

Input#

Argument NameDescriptionRequired
user_idUser ID to use Teams as (can be principal ID (email address)).Optional
subjectThe title of the chat.Required
typeSpecifies the type of chat. Possible values are: group and oneOnOne. Possible values are: group, oneOnOne. Default is group.Optional
membersA comma-separated list members that should be added. using user principal name (email).Required

Context Output#

PathTypeDescription
MSGraphTeamsChat.IDStringThe ID of the chat.
MSGraphTeamsChat.UserIDStringThe ID of the user.
MSGraphTeamsChat.SubjectStringThe title of the chat.
MSGraphTeamsChat.CreatedDateThe time the chat was created.
MSGraphTeamsChat.LastUpdatedTimeDateThe time the chat was last updated.
MSGraphTeamsChat.TypeStringThe type of chat.

msgraph-teams-get-chat#


Retrieve a single chat (without its messages).

Base Command#

msgraph-teams-get-chat

Input#

Argument NameDescriptionRequired
user_idUser ID to use Teams as (can be principal ID (email address)).Optional
chat_idThe chat's unique identifier.Required

Context Output#

PathTypeDescription
MSGraphTeamsChat.IDStringThe ID of the chat.
MSGraphTeamsChat.UserIDStringThe ID of the user.
MSGraphTeamsChat.SubjectStringThe title of the chat.
MSGraphTeamsChat.CreatedDateThe time the chat was created.
MSGraphTeamsChat.LastUpdatedTimeDateThe time the chat was last updated.
MSGraphTeamsChat.TypeStringThe type of chat.

msgraph-teams-update-chat#


Update the properties of a chat object.

Base Command#

msgraph-teams-update-chat

Input#

Argument NameDescriptionRequired
chat_idThe chat's unique identifier.Required
subjectThe title of the chat.Required

Context Output#

PathTypeDescription
MSGraphTeamsChat.IDStringThe ID of the chat.
MSGraphTeamsChat.UserIDStringThe ID of the user.
MSGraphTeamsChat.SubjectStringThe title of the chat.
MSGraphTeamsChat.CreatedDateThe time the chat was created.
MSGraphTeamsChat.LastUpdatedTimeDateThe time the chat was last updated.
MSGraphTeamsChat.TypeStringThe type of chat.

msgraph-teams-list-members#


List all conversation members in a chat.

Base Command#

msgraph-teams-list-members

Input#

Argument NameDescriptionRequired
user_idUser ID to use Teams as (can be principal ID (email address)).Optional
chat_idThe chat's unique identifier.Required

Context Output#

PathTypeDescription
MSGraphTeamsChatMember.IDStringThe ID of the chat member.
MSGraphTeamsChatMember.NameStringThe display name of the chat member.
MSGraphTeamsChatMember.HistoryStartTimeDateThe timestamp denoting how far back a conversation's history is shared with the conversation member. This property is settable only for members of a chat.
MSGraphTeamsChatMember.ChatIDunknownThe ID of the chat.

msgraph-teams-add-member#


Add a conversationMember to a chat.

Base Command#

msgraph-teams-add-member

Input#

Argument NameDescriptionRequired
chat_idThe chat's unique identifier.Required
user_idUser ID to add to Teams chat (can be principal ID (email address)).Required
share_historyAllowing sharing of the whole history of the chat. Possible values are: true, false. Default is true.Optional

Context Output#

There is no context output for this command.

msgraph-teams-list-messages#


Retrieve the list of messages in a chat.

Base Command#

msgraph-teams-list-messages

Input#

Argument NameDescriptionRequired
user_idUser ID to use Teams as (can be principal ID (email address)).Optional
chat_idThe chat's unique identifier.Required
limitLimit messages to fetch in one request. Default is 50.Optional

Context Output#

PathTypeDescription
MSGraphTeamsChatMessage.IDStringThe ID of the message.
MSGraphTeamsChatMessage.ChatIDStringThe ID of the chat.
MSGraphTeamsChatMessage.FromStringThe Name of the sender of the chat message.
MSGraphTeamsChatMessage.CreatedDateTimestamp of when the chat message was created.
MSGraphTeamsChatMessage.LastModifiedTimeDateTimestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
MSGraphTeamsChatMessage.BodyhtmlBodyHTML representation of the content of the chat message. Representation is specified by the contentType inside the body.

msgraph-teams-send-message#


Send a new message in a chat.

Base Command#

msgraph-teams-send-message

Input#

Argument NameDescriptionRequired
chat_idThe chat's unique identifier.Required
bodyHTML representation of the content of the chat message. Representation is specified by the contentType inside the body.Required

Context Output#

PathTypeDescription
MSGraphTeamsChatMessage.IDStringThe ID of the message.
MSGraphTeamsChatMessage.chatIDStringThe ID of the chat.
MSGraphTeamsChatMessage.FromStringThe Name of the sender of the chat message.
MSGraphTeamsChatMessage.CreatedDateTimestamp of when the chat message was created.
MSGraphTeamsChatMessage.LastModifiedTimeDateTimestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.
MSGraphTeamsChatMessage.BodyhtmlBodyHTML representation of the content of the chat message. Representation is specified by the contentType inside the body.

msgraph-teams-test#


Tests connectivity to Microsoft Graph Teams.

Base Command#

msgraph-teams-test

Input#

Argument NameDescriptionRequired

Context Output#

There is no context output for this command.

msgraph-teams-auth-reset#


Run this command if for some reason you need to rerun the authentication process.

Base Command#

msgraph-teams-auth-reset

Input#

Argument NameDescriptionRequired

Context Output#

There is no context output for this command.

msgraph-teams-generate-login-url#


Generate the login url used for Authorization code flow.

Base Command#

msgraph-teams-generate-login-url

Input#

Argument NameDescriptionRequired

Context Output#

There is no context output for this command.