getChannelsInbox method

Future<InboxPage?> getChannelsInbox({
  1. String? since,
  2. String? limit,
})

Returns the messages people have sent to the caller org's connected chat bots, oldest first, in the portable envelope shape every transport normalises into.

Returns the messages people have sent to the caller org's connected chat bots, oldest first, in the portable envelope shape every transport normalises into. It is a CURSOR feed, not a search: pass the returned cursor back as since to get only what has arrived since. Only this org's messages are stored under this org, so the feed can never carry another tenant's chat.

Parameters:

  • String since: Since is the exclusive cursor: only messages with a higher row id come back. Empty starts at the beginning. Must parse as an integer.

  • String limit: Limit caps how many messages come back. Empty or 0 uses the store's default page size. Must parse as an integer.

Implementation

Future<InboxPage?> getChannelsInbox({ String? since, String? limit, }) async {
  final response = await getChannelsInboxWithHttpInfo( since: since, limit: limit, );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'InboxPage',) as InboxPage;

  }
  return null;
}