Chat Threads

chat/threads@1.0.0
Supported by 1 provider
D

Get Threads

Retrieve list of threads from the whole workspace.

Input
Workspace
Result
Threads
Rate Limit

1.Choose a provider

2.Use GetThreads 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/threads@1.0.0');

  // Use the profile
  const result = await profile
    .getUseCase('GetThreads')
    .perform({
      workspace: 'workspace_id'
    }, {
      provider: 'mock'
    });

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

run();

Structure details

Input (object)

workspace
Identifier of a workspace, for example a Discord guild or a Slack workspace.

Example

{
  "workspace": "workspace_id"
}

Result (object)

threads
List of retrieved threads
rateLimit
Rate limit details.

Example

{
  "threads": [
    {
      "id": "1",
      "createdAt": 1546167104000,
      "channel": "random"
    }
  ]
}

Implementation details

Provider
mock
Use case
GetThreads
Author
@superface
Source
Verified