Share via


TeamsConnectorClient class

A client for interacting with Microsoft Teams APIs. Extends the ConnectorClient class to provide Teams-specific functionalities.

Constructors

TeamsConnectorClient(ConnectorClient)

Methods

cancelOperation(string)

Cancels a batch operation.

fetchChannelList(string)

Fetches the list of channels in a team.

fetchMeetingInfo(string)

Fetches information about a meeting.

fetchMeetingParticipant(string, string, string)

Fetches information about a meeting participant.

fetchTeamDetails(string)

Fetches the details of a team.

getConversationMember(string, string)

Retrieves a member from a conversation.

getConversationPagedMember(string, number, string)

Retrieves paged members of a conversation.

getFailedEntries(string)

Retrieves the failed entries of a batch operation.

getMember(Activity, string)

Retrieves a member from a conversation or team.

getMemberInternal(any, undefined | string, string)

Retrieves a member from a conversation or team internally.

getOperationState(string)

Retrieves the state of a batch operation.

getTeamMember(any, string, string)

Retrieves a member from a team.

sendMeetingNotification(string, TargetedMeetingNotification)

Sends a notification to a meeting.

sendMessageToAllUsersInTeam(Activity, string, string)

Sends a message to all users in a team.

sendMessageToAllUsersInTenant(Activity, string)

Sends a message to all users in a tenant.

sendMessageToListOfChannels(Activity, string, TeamsMember[])

Sends a message to a list of channels.

sendMessageToListOfUsers(Activity, string, TeamsMember[])

Sends a message to a list of users.

Constructor Details

TeamsConnectorClient(ConnectorClient)

new TeamsConnectorClient(client: ConnectorClient)

Parameters

Method Details

cancelOperation(string)

Cancels a batch operation.

function cancelOperation(operationId: string): Promise<CancelOperationResponse>

Parameters

operationId

string

The ID of the operation.

Returns

A CancelOperationResponse object containing the response.

fetchChannelList(string)

Fetches the list of channels in a team.

function fetchChannelList(teamId: string): Promise<ChannelInfo[]>

Parameters

teamId

string

The ID of the team.

Returns

Promise<ChannelInfo[]>

An array of ChannelInfo objects representing the channels.

fetchMeetingInfo(string)

Fetches information about a meeting.

function fetchMeetingInfo(meetingId: string): Promise<MeetingInfo>

Parameters

meetingId

string

The ID of the meeting.

Returns

Promise<MeetingInfo>

A MeetingInfo object containing the meeting information.

fetchMeetingParticipant(string, string, string)

Fetches information about a meeting participant.

function fetchMeetingParticipant(meetingId: string, participantId: string, tenantId: string): Promise<string>

Parameters

meetingId

string

The ID of the meeting.

participantId

string

The ID of the participant.

tenantId

string

The tenant ID.

Returns

Promise<string>

A string containing participant information.

fetchTeamDetails(string)

Fetches the details of a team.

function fetchTeamDetails(teamId: string): Promise<TeamDetails>

Parameters

teamId

string

The ID of the team.

Returns

Promise<TeamDetails>

A TeamDetails object containing the team details.

getConversationMember(string, string)

Retrieves a member from a conversation.

function getConversationMember(conversationId: string, userId: string): Promise<ChannelAccount>

Parameters

conversationId

string

The ID of the conversation.

userId

string

The ID of the user to retrieve.

Returns

Promise<ChannelAccount>

A ChannelAccount representing the conversation member.

getConversationPagedMember(string, number, string)

Retrieves paged members of a conversation.

function getConversationPagedMember(conversationId: string, pageSize: number, continuationToken: string): Promise<TeamsPagedMembersResult>

Parameters

conversationId

string

The ID of the conversation.

pageSize

number

The number of members per page.

continuationToken

string

The token for pagination.

Returns

A TeamsPagedMembersResult containing the paged members.

getFailedEntries(string)

Retrieves the failed entries of a batch operation.

function getFailedEntries(operationId: string): Promise<BatchFailedEntriesResponse>

Parameters

operationId

string

The ID of the operation.

Returns

A BatchFailedEntriesResponse object containing the failed entries.

getMember(Activity, string)

Retrieves a member from a conversation or team.

static function getMember(activity: Activity, userId: string): Promise<TeamsChannelAccount>

Parameters

activity
Activity

The activity containing the context.

userId

string

The ID of the user to retrieve.

Returns

A TeamsChannelAccount representing the member.

getMemberInternal(any, undefined | string, string)

Retrieves a member from a conversation or team internally.

static function getMemberInternal(activity: any, conversationId: undefined | string, userId: string): Promise<ChannelAccount>

Parameters

activity

any

The activity containing the context.

conversationId

undefined | string

The ID of the conversation.

userId

string

The ID of the user to retrieve.

Returns

Promise<ChannelAccount>

A ChannelAccount representing the member.

getOperationState(string)

Retrieves the state of a batch operation.

function getOperationState(operationId: string): Promise<BatchOperationStateResponse>

Parameters

operationId

string

The ID of the operation.

Returns

A BatchOperationStateResponse object containing the operation state.

getTeamMember(any, string, string)

Retrieves a member from a team.

static function getTeamMember(activity: any, teamId?: string, userId?: string): Promise<ChannelAccount>

Parameters

activity

any

The activity containing the context.

teamId

string

The ID of the team.

userId

string

The ID of the user to retrieve.

Returns

Promise<ChannelAccount>

A TeamsChannelAccount representing the team member.

sendMeetingNotification(string, TargetedMeetingNotification)

Sends a notification to a meeting.

function sendMeetingNotification(meetingId: string, notification: TargetedMeetingNotification): Promise<MeetingNotificationResponse>

Parameters

meetingId

string

The ID of the meeting.

notification
TargetedMeetingNotification

The notification to send.

Returns

Promise<MeetingNotificationResponse>

A MeetingNotificationResponse object containing the response.

sendMessageToAllUsersInTeam(Activity, string, string)

Sends a message to all users in a team.

function sendMessageToAllUsersInTeam(activity: Activity, tenantId: string, teamId: string): Promise<TeamsBatchOperationResponse>

Parameters

activity
Activity

The activity to send.

tenantId

string

The tenant ID.

teamId

string

The team ID.

Returns

A TeamsBatchOperationResponse object containing the response.

sendMessageToAllUsersInTenant(Activity, string)

Sends a message to all users in a tenant.

function sendMessageToAllUsersInTenant(activity: Activity, tenantId: string): Promise<TeamsBatchOperationResponse>

Parameters

activity
Activity

The activity to send.

tenantId

string

The tenant ID.

Returns

A TeamsBatchOperationResponse object containing the response.

sendMessageToListOfChannels(Activity, string, TeamsMember[])

Sends a message to a list of channels.

function sendMessageToListOfChannels(activity: Activity, tenantId: string, members: TeamsMember[]): Promise<TeamsBatchOperationResponse>

Parameters

activity
Activity

The activity to send.

tenantId

string

The tenant ID.

members

TeamsMember[]

The list of members to send the message to.

Returns

A TeamsBatchOperationResponse object containing the response.

sendMessageToListOfUsers(Activity, string, TeamsMember[])

Sends a message to a list of users.

function sendMessageToListOfUsers(activity: Activity, tenantId: string, members: TeamsMember[]): Promise<TeamsBatchOperationResponse>

Parameters

activity
Activity

The activity to send.

tenantId

string

The tenant ID.

members

TeamsMember[]

The list of members to send the message to.

Returns

A TeamsBatchOperationResponse object containing the response.