Chat Members

chat/members@1.0.0
Supported by 2 providers
D
S

Get workspace members

Retrieve paginated list of members

Input
Workspace
Limit
Page
Result
Members
Next Page
Rate Limit

1.Choose a provider

2.Use GetMembers with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('chat/members@1.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('GetMembers')
    .perform({
      workspace: '877903817948147752',
      limit: 2
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

workspace
Representation of a workspace. Can be ID or name, depending on the provider capability.
limit
Maximum number of records to retrieve
page
Page cursor retrieved from nextPage for results pagination

Example

{
  "workspace": "877903817948147752",
  "limit": 2
}

Result (object)

members
List of retrieved members
nextPage
Cursor to the next page of listing
rateLimit
Rate limit details.

Example

{
  "members": [
    {
      "id": "1",
      "username": "user1",
      "joinedAt": 1643798532134.069
    }
  ]
}

Implementation details

Provider
mock
Use case
GetMembers
Author
@superface
Source
Verified