addLabelsToContent method

Future<LabelArray> addLabelsToContent({
  1. required String id,
  2. required dynamic body,
})

Adds labels to a piece of content. Does not modify the existing labels.

Notes:

  • Labels can also be added when creating content (Create content).
  • Labels can be updated when updating content (Update content). This will delete the existing labels and replace them with the labels in the request.

Permissions required: Permission to update the content.

Implementation

Future<LabelArray> addLabelsToContent(
    {required String id, required dynamic body}) async {
  return LabelArray.fromJson(await _client.send(
    'post',
    'wiki/rest/api/content/{id}/label',
    pathParameters: {
      'id': id,
    },
    body: body,
  ));
}