movePage method

Future<Map<String, dynamic>> movePage({
  1. required String pageId,
  2. required String position,
  3. required String targetId,
})

Move a page to a new location relative to a target page:

  • before - move the page under the same parent as the target, before the target in the list of children
  • after - move the page under the same parent as the target, after the target in the list of children
  • append - move the page to be a child of the target

Caution: This API can move pages to the top level of a space. Top-level pages are difficult to find in the UI because they do not show up in the page tree display. To avoid this, never use before or after positions when the targetId is a top-level page.

Implementation

Future<Map<String, dynamic>> movePage(
    {required String pageId,
    required String position,
    required String targetId}) async {
  return await _client.send(
    'put',
    'wiki/rest/api/content/{pageId}/move/{position}/{targetId}',
    pathParameters: {
      'pageId': pageId,
      'position': position,
      'targetId': targetId,
    },
  ) as Map<String, Object?>;
}