readChats Documentation
Overview
This node facilitate the retrieval of Microsoft Teams chat data that a user is part of. When invoked, it returns a structured output containing a list of chat objects, each representing a chat that the user can access within their Microsoft Teams environment. This component plays a crucial role in analytics and data reporting, allowing users to analyze their chat interactions and derive insights from them.
Purpose
The primary purpose of the readChats component is to interact with the Microsoft Teams Chat API to list the chats associated with a particular user. It simplifies the process of accessing chat data, thereby enabling advanced analytics and reporting features in the Vantage analytics platform.
Settings
The readChats component has a single configurable setting:
Setting: maxResults
- Setting Name:
maxResults - Input Type: Numeric (integer)
- Description: This setting defines the maximum number of chat records to retrieve from Microsoft Teams. The value must be constrained to the range of 1 to 50. The component defaults this setting to 25 if not provided, which means that if the user doesn't specify this parameter, it will only return up to 25 chat records by default. By changing this setting, users can control how many chat records they wish to fetch, which can affect response time and the amount of data processed in subsequent operations or visualizations.
- Default Value: 25
How It Works
The readChats component operates asynchronously to ensure non-blocking interactions with the Teams API. Here's a step-by-step breakdown of its operation:
-
Integration Initialization: The function begins by establishing a connection to the Microsoft Teams chat integration via integration connection. This process utilizes the provided
contextto authenticate and configure the connection settings. -
Input Handling: It retrieves the
maxResultsparameter from the inputs or the configuration object. A validation process is performed to ensure the value is an integer within the acceptable range (1 to 50). If themaxResultsparameter exceeds these constraints, the function adjusts it accordingly. -
Chat Retrieval: Once the
maxResultsparameter is validated, the function calls thelistChatsmethod of the Teams chat integration. This method sends a request to the Microsoft Teams API to retrieve the specified number of chats. -
Data Mapping: The result obtained from the API call is processed. Each chat object returned is transformed into a more manageable format using the
TeamsChatIntegration.chatToRowmapping logic. -
Output Preparation: Finally, the component returns an object encapsulating the structured list of chats and metadata, including the total number of results.
-
Error Handling: If an error occurs during any of these steps, it is caught, logged to the console, and an error message is returned.
Expected Data
The node expects the following data types:
- Inputs: An object containing the
maxResultsparameter, which should be an integer. - Context: An optional object that may contain configuration settings or credentials required to connect to Microsoft Teams.
The structure of the output data includes:
- output1: An object containing:
- data: An array of chat objects, where each object contains properties such as
id,topic,chatType,members, etc. - metadata: An object that includes the total number of chats returned in the
dataarray.
- data: An array of chat objects, where each object contains properties such as
AI Integrations
Currently, there are no direct AI integrations within the readChats component itself. However, the retrieved chat data can serve as input for subsequent analytics processes, which may leverage AI capabilities for sentiment analysis, trend identification, or other forms of data intelligence in later stages of the data pipeline.
Billing Impact
The readChats component's usage may have implications on billing depending on the following factors:
- API Call Cost: Depending on the terms of usage with Microsoft Teams, API calls to retrieve chat data might incur costs. Frequent or excessive usage could lead to increased expenses, especially if large datasets are requested.
- Data Processing Charges: The data retrieved may lead to additional processing charges in the Vantage platform if it triggers workflows or additional features that are billable based on data volume or processing time.
Use Cases & Examples
Use Case 1: Monitoring Team Collaboration
A project manager may wish to monitor team interaction within Microsoft Teams to gauge the level of engagement among team members. Using the readChats component, they can retrieve a list of chats relevant to their projects, helping identify active discussions and contributions from team members.
Use Case 2: Evaluating Customer Support Interactions
A customer support team can use this node to analyze conversations held with customers. By extracting data from relevant chats, the team can identify trends in customer inquiries and evaluate support response strategies.
Example Configuration
Use Case Detail: An analytics team needs to evaluate chat activity during a product development cycle. They want to ensure they review a maximum of 30 recent chats.
Sample Configuration:
{
"inputs": {
"maxResults": 30
},
"config": {
"maxResults": 25 // This can be overridden by inputs
},
"context": {
"userId": "12345-abcde-67890",
"authorization": "Bearer token_string_here"
}
}In this configuration, the team will retrieve up to 30 chat records, ensuring they can adequately assess team communications during the relevant phase of product development. This targeted retrieval allows for focused analysis without overwhelming datasets.