getBlogPostById method

Future<BlogPostSingle> getBlogPostById({
  1. required int id,
  2. String? bodyFormat,
  3. bool? getDraft,
  4. int? version,
  5. bool? serializeIdsAsStrings,
})

Returns a specific blog post.

Permissions required: Permission to view the blog post and its corresponding space.

Implementation

Future<BlogPostSingle> getBlogPostById(
    {required int id,
    String? bodyFormat,
    bool? getDraft,
    int? version,
    bool? serializeIdsAsStrings}) async {
  return BlogPostSingle.fromJson(await _client.send(
    'get',
    'blogposts/{id}',
    pathParameters: {
      'id': '$id',
    },
    queryParameters: {
      if (bodyFormat != null) 'body-format': bodyFormat,
      if (getDraft != null) 'get-draft': '$getDraft',
      if (version != null) 'version': '$version',
      if (serializeIdsAsStrings != null)
        'serialize-ids-as-strings': '$serializeIdsAsStrings',
    },
  ));
}