copyPageHierarchy method

Future<LongTask> copyPageHierarchy({
  1. required String id,
  2. required CopyPageHierarchyRequest body,
})

Copy page hierarchy allows the copying of an entire hierarchy of pages and their associated properties, permissions and attachments. The id path parameter refers to the content id of the page to copy, and the new parent of this copied page is defined using the destinationPageId in the request body. The titleOptions object defines the rules of renaming page titles during the copy; for example, search and replace can be used in conjunction to rewrite the copied page titles.

Response example:

`
 {
      "id" : "1180606",
      "links" : {
           "status" : "/rest/api/longtask/1180606"
      }
 }
 `

Use the /longtask/

Implementation

Future<LongTask> copyPageHierarchy(
    {required String id, required CopyPageHierarchyRequest body}) async {
  return LongTask.fromJson(await _client.send(
    'post',
    'wiki/rest/api/content/{id}/pagehierarchy/copy',
    pathParameters: {
      'id': id,
    },
    body: body.toJson(),
  ));
}