Skip to content

Azuregraph

flowtask.interfaces.AzureGraph

AzureGraph

AzureGraph(tenant_id=None, client_id=None, client_secret=None, scopes=None, **kwargs)

Bases: ClientInterface

AzureGraph

Overview

    Authentication and authorization Using Azure Identity and Microsoft Graph.

find_chat_by_name async

find_chat_by_name(chat_name, user=None)

Finds a chat by its name (topic) and returns its chat_id.

Parameters:

Name Type Description Default
chat_name str

The name of the chat to find.

required

Returns:

Type Description
Optional[str]

Optional[str]: The chat_id if found, else None.

find_one_on_one_chat async

find_one_on_one_chat(user_id_1, user_id_2)

Find the one-on-one chat between two users by their object IDs. Returns the chat_id or None if it doesn't exist.

get_channel_details async

get_channel_details(team_id, channel_id)

Fetches details of a Teams channel.

Parameters:

Name Type Description Default
team_id str

The ID of the team.

required
channel_id str

The ID of the channel.

required

Returns:

Name Type Description
Dict Dict

A dictionary containing channel details.

get_channel_members async

get_channel_members(team_id, channel_id)

Fetches the list of members in a Teams channel.

Parameters:

Name Type Description Default
team_id str

The ID of the team.

required
channel_id str

The ID of the channel.

required

Returns:

Type Description
List[Dict]

List[Dict]: A list of member objects.

get_chat_messages async

get_chat_messages(chat_id, start_time=None, end_time=None, messages_per_page=50, max_messages=None)

Get chat messages.

Parameters:

Name Type Description Default
chat_id str

Id of Chat

required

Returns:

Type Description
Optional[List]

Optional[List]: All Chat Messages based on criteria.

get_msteams_channel_messages async

get_msteams_channel_messages(team_id, channel_id, start_time=None, end_time=None, max_messages=None)

Fetches messages from a Teams channel.

Parameters:

Name Type Description Default
team_id str

The ID of the team.

required
channel_id str

The ID of the channel.

required
start_time str

ISO 8601 formatted start time to filter messages.

None
end_time str

ISO 8601 formatted end time to filter messages.

None
max_messages int

Maximum number of messages to retrieve.

None

Returns:

Type Description
List[Dict]

List[Dict]: A list of message objects.

get_token async

get_token()

Retrieves an access token for Microsoft Graph API using ClientSecretCredential.

get_user async

get_user(user_id)

Fetches user information from Microsoft Graph API based on user ID.

Parameters:

Name Type Description Default
user_id str

The Azure AD object ID of the user.

required

Returns:

Name Type Description
Dict Dict

User information as a dictionary.

get_user_info async

get_user_info(user_principal_name)

Fetches user information from Microsoft Graph API basado en el userPrincipalName o ID.

Parameters:

Name Type Description Default
user_principal_name str

the UPN (email) or the objectId of the user.

required

Returns:

Name Type Description
dict dict

Información del usuario.

list_chats async

list_chats(user)

Lists all chats accessible to the application or user.

Returns:

Type Description
List[Dict]

List[Dict]: A list of chat objects.

list_user_chats async

list_user_chats(user_id)

List all chats where user_id participates.

open

open(**kwargs)

Initializes the Microsoft Graph client using: - MSAL + StaticTokenCredential if user+password is provided (delegated flow). - ClientSecretCredential for app-only in other cases.

user_chat_messages async

user_chat_messages(user, chat_id, start_time=None, end_time=None, messages_per_page=50, max_messages=None, max_retries=3)

Get User chat messages.

Parameters:

Name Type Description Default
chat_id str

Id of Chat

required

Returns:

Type Description
Optional[List]

Optional[List]: All Chat Messages based on criteria.