Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

List all scheduled messages

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

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

ScheduledMessageListQueryParams

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

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.