Compartilhar via


GetRootContainer (ecosystem)

iOS and Android Desktop

GET /wopi/ecosystem/root_container_pointer

The GetRootContainer operation returns the root container. A WOPI client can use this operation to get a reference to the root container, from which the client can call EnumerateChildren (containers) to navigate a container hierarchy.

Note

This operation is also exposed as a shortcut operation.

Query Parameters

  • access_token (string) – An access token that the host will use to determine whether the request is authorized.

Status Codes

Note

In addition to the request/response headers listed here, this operation may also use the Standard WOPI request and response headers.

Response

The response to a GetRootContainer call is JSON.

All optional values default to the following values based on their type:

Type Default value
Boolean false
String The empty string
Integer/Long Varies; see individual properties for details
Array Empty array

Important

No properties should be set to null. If you do not wish to set a property, simply omit it from the response; WOPI clients will use the default value in these cases.

Required response properties

The following properties must be present in all GetRootContainer responses:

  • ContainerPointer - A JSON-formatted object containing the following properties:

  • Name The name of the container without a path. This value should match the Name property in a CheckContainerInfo response. Required.

  • Url - A URI to the container, including a valid access token. Required.

    Caution

    This property includes an access token, and thus has important security implications. See Preventing ‘token trading’ for more details.

Other response properties

  • ContainerInfo - Hosts can optionally include the ContainerInfo property, which should match the CheckContainerInfo response for the root container.

    If not provided, the WOPI client will call CheckContainerInfo to retrieve it. We strongly recommend including this property in the response so that the WOPI client does not need to make an additional call to CheckContainerInfo.

Sample response:

{
  "ContainerPointer" : {
    "Url" : "http://.../wopi*/containers/<containerId>?access_token=<per_container_token>",
    "Name" : "Container Name"
  },
  "ContainerInfo" : {
    "Name" : "Container Name",
    "HostUrl" : "",
    "SharingUrl" : "",
    "UserCanCreateChildContainer" : false,
    "UserCanCreateChildFile" : false,
    "UserCanDelete" : false,
    "UserCanRename" : false
  }
}