/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

List all scheduled messages

Copy link

Create a ScheduleMessageListQuery instance to retrieve all scheduled messages matching the specifications set by ScheduledMessageListQueryParams.

JavaScriptTypeScript
const params = {
  channelUrl: CHANNEL_URL,
  scheduledStatus: [ScheduledStatus.PENDING],
};
const scheduledMessageListQuery = sb.groupChannel.createScheduledMessageListQuery(params);
const queriedScheduledMessages = await scheduledMessageListQuery.next();

ScheduledMessageListQueryParams

Copy link
Property nameTypeDescription

order?

enum

Determines the order of the retrieved messages. Acceptable values are CREATED_AT and SCHEDULED_AT. (Default: CREATED_AT)

messageTypeFilter

enum

Specifies the message type to filter the messages with the corresponding type. Acceptable values are ALL, USER, FILE, and ADMIN. (Default: ALL)

reverse?

boolean

Determines whether to sort the retrieved messages in reverse order. If false, the results are in ascending order. (Default: false)

channelUrl?

string

Specifies a target channel to query the scheduled messages from. If null, it retrieves scheduled messages from all channels. (Default: null)

scheduledStatus?

list

Specifies list of ScheduledStatus where scheduled messages with only given ScheduledStatus are retrieved. (Default: null)

limit

int

Specifies the number of results to return per call. Acceptable values are 1 to 100, inclusive. (Default: 20)

ScheduledMessageListQuery

Copy link
Property nameTypeDescription

limit

int

Specifies the number of results to return per call. Acceptable values are 1 to 100, inclusive. The recommended value for this parameter is 30.

channelUrl

string

Specifies the url of a group channel.

order

ScheduledMessageListOrder

Specifies the sort order of messages being fetched. Acceptable values are ScheduledMessageListOrder.CREATED_AT, and ScheduledMessageListOrder.SCHEDULED_AT.

reverse

boolean

Determines whether to sort the retrieved messages in reverse order. If false, the results are in ascending order.

scheduledStatus

ScheduledStatus

Specifies the list of scheduled status of scheduled messages to fetch. Acceptable values are ScheduledStatus.PENDING, ScheduledStatus.SENT, ScheduledStatus.FAILED, and ScheduledStatus.CANCELED.

messageTypeFilter

enum

Specifies the message type to filter the messages with the corresponding type. Acceptable values are MessageTypeFilter.ALL, MessageTypeFilter.USER, MessageTypeFilter.FILE, MessageTypeFilter.ADMM, and MessageTypeFilter.ALL.