getHelpArticles method

Future<HelpArticleList?> getHelpArticles({
  1. String? category,
  2. int? limit,
})

Returns the public knowledge base: the help center's Published, publicly-visible articles as cards.

Returns the public knowledge base: the help center's Published, publicly-visible articles as cards. The org is server-fixed and the status/is_public filter is server-set, so neither the tenant nor the visibility can be widened by the caller. A deployment with no help center answers 404.

Parameters:

  • String category: Category narrows the list to one knowledge-base section, matched against the article's category by exact name. Empty lists every section.

  • int limit: Limit caps how many articles are returned. Anything that is not a positive integer uses 50, and values above 200 are clamped to 200.

Implementation

Future<HelpArticleList?> getHelpArticles({ String? category, int? limit, }) async {
  final response = await getHelpArticlesWithHttpInfo( category: category, 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), 'HelpArticleList',) as HelpArticleList;

  }
  return null;
}