You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.

Chat Threads

chat/threads@1.0.2
1 provider

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

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk

Structure details

Input (object)

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

Example

Result (object)

threads
List of retrieved threads
id
Unique identifier of the thread
createdAt
UNIX timestamp (in milliseconds, e.g. 1095379198750) when the thread was created
channel
Unique identifier of the channel where the thread is located
archiveAt
UNIX timestamp (in milliseconds, e.g. 1095379198750) when the thread will be archived Some providers limit the lifetime of threads and automatically archive them after some time period of inactivity.
name
Name of retrieved thread
membersCount
Number of users participating in the thread
messagesCount
Number of messages in the retrieved thread
lastMessageAt
UNIX timestamp (in milliseconds, e.g. 1095379198750) when was the last message sent to thread.
rateLimit
Rate limit details.
bucket
Different parts of API may have different rate limits. Bucket identifies to which part of API the rate limits apply.
totalRequests
Total requests available in the time window.
remainingRequests
Remaining requests available in the time window.
remainingRequestsPercentage
Remaining requests available in the time window in percents.
resetTimestamp
Timestamp when the rate limits will reset (in Unix Timestamp ms format).
resetAfter
Number of seconds until reset of rate limit
retryAfter
Number of seconds until user can retry the request

Example

Implementation details

Provider
mock
Use case
GetThreads
Author
@superface
Source
Verified