createContent method

  1. @deprecated
Future<Content> createContent({
  1. String? status,
  2. List<String>? expand,
  3. required ContentCreate body,
})

Deprecated, use Confluence's v2 API.

Creates a new piece of content or publishes an existing draft.

To publish a draft, add the id and status properties to the body of the request. Set the id to the ID of the draft and set the status to 'current'. When the request is sent, a new piece of content will be created and the metadata from the draft will be transferred into it.

By default, the following objects are expanded: space, history, version.

Permissions required: 'Add' permission for the space that the content will be created in, and permission to view the draft if publishing a draft.

Implementation

@deprecated
Future<Content> createContent(
    {String? status,
    List<String>? expand,
    required ContentCreate body}) async {
  return Content.fromJson(await _client.send(
    'post',
    'wiki/rest/api/content',
    queryParameters: {
      if (status != null) 'status': status,
      if (expand != null) 'expand': expand.map((e) => e).join(','),
    },
    body: body.toJson(),
  ));
}