getOrganizationEmailsPaginated method
Get all organization emails. List team or shared test email accounts
By default returns all emails across all team inboxes sorted by ascending created at date. Responses are paginated. You can restrict results to a list of inbox IDs. You can also filter out read messages
Parameters:
-
List<String> inboxId: Optional inbox ids to filter by. Can be repeated. By default will use all inboxes belonging to your account.
-
int page: Optional page index in email list pagination
-
int size: Optional page size in email list pagination. Maximum size is 100. Use page index and sort to page through larger results
-
String sort: Optional createdAt sort direction ASC or DESC
-
bool unreadOnly: Optional filter for unread emails only. All emails are considered unread until they are viewed in the dashboard or requested directly
-
String searchFilter: Optional search filter search filter for emails.
-
DateTime since: Optional filter emails received after given date time
-
DateTime before: Optional filter emails received before given date time
Implementation
Future<PageEmailProjection?> getOrganizationEmailsPaginated({ List<String>? inboxId, int? page, int? size, String? sort, bool? unreadOnly, String? searchFilter, DateTime? since, DateTime? before, }) async {
final response = await getOrganizationEmailsPaginatedWithHttpInfo( inboxId: inboxId, page: page, size: size, sort: sort, unreadOnly: unreadOnly, searchFilter: searchFilter, since: since, before: before, );
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), 'PageEmailProjection',) as PageEmailProjection;
}
return null;
}