getContentTemplates method

Future<ContentTemplateArray> getContentTemplates({
  1. String? spaceKey,
  2. int? start,
  3. int? limit,
  4. List<String>? expand,
})

Returns all content templates. Use this method to retrieve all global content templates or all content templates in a space.

Permissions required: 'View' permission for the space to view space templates and permission to access the Confluence site ('Can use' global permission) to view global templates.

Implementation

Future<ContentTemplateArray> getContentTemplates(
    {String? spaceKey, int? start, int? limit, List<String>? expand}) async {
  return ContentTemplateArray.fromJson(await _client.send(
    'get',
    'wiki/rest/api/template/page',
    queryParameters: {
      if (spaceKey != null) 'spaceKey': spaceKey,
      if (start != null) 'start': '$start',
      if (limit != null) 'limit': '$limit',
      if (expand != null) 'expand': expand.map((e) => e).join(','),
    },
  ));
}