4 min read

listUsers Documentation

Purpose

This node interact with Slack's API to retrieve a list of users belonging to a specific team. This function fetches user details based on provided parameters such as team ID and pagination controls. It serves as a crucial utility for applications needing to manage or interact with user data within a Slack workspace, enabling further integrations, analytics, or user management tasks.

Settings

Setting: teamId

Setting: limit

Setting: cursor

How It Works

  1. Input Handling: The function begins by initializing teamId, limit, and cursor from the provided inputs or from defaults in the configuration if not supplied.
  2. Connection Establishment: It utilizes the utility function the integration connection to establish a connection to the Slack API. This function is provided with the connection type "slack" and the current context.
  3. API Call: After a successful connection, it invokes the listUsers method from the Slack integration object. This method passes the confirmed parameters (teamId, limit, and cursor) to retrieve the user data.
  4. Error Handling: If any errors occur during data fetching, a structured error message is returned with details regarding the internal failure.
  5. Output: Upon successful retrieval of user data, the output is returned in an object with the key output1, containing the user data.

Data Expectations

The response data will adhere to the format provided by the Slack API, typically including user identifiers, names, and other relevant user metadata.

AI Integrations & Billing Impact

Use Cases & Examples

Use Case 1: Team Directory Management

A company may want to build a directory application that lists all users in their Slack workspace, providing quick access to team members' contact details and roles.

Use Case 2: Analytics on User Activity

An analytics platform can utilize the listUsers method to fetch user data that can help analyze engagement rates, determine active users, or assess team structures for reporting purposes.

Use Case 3: Slack User Synchronization

A HR management system needs to sync its internal user database with Slack to ensure that data is consistent across platforms.

Example Configuration for Use Case 1: Team Directory Management

Here is a sample configuration for retrieving user data for a team directory:

json
{
  "inputs": {
    "teamId": "T012345678",
    "limit": 100,
    "cursor": null
  },
  "config": {
    "teamId": "T012345678",
    "limit": 200,
    "cursor": null
  }
}

In this example, the settings allow for up to 100 users to be fetched at once from the specified Slack team. If the team has more than 100 users, additional calls can be made using pagination with the cursor returned from the initial call.

This structured documentation provides a comprehensive overview of this node, ensuring users can fully leverage its capabilities within the Vantage analytics platform.