Example 8: Enumerate folders and workspaces |
This example gets a list of all folders and workspaces that the user has access to. There are two steps: get a list of all workspaces and then get a list of all folders in these workspaces.
Resource.Workspaces workspaces = apiSession.GetWorkspacesResource(); // This returns a list of rooms, which can be iterated over. The other parameters // include: addExternalData, adminMode, includeSyncData, includeWorkspacePolicyData, // and workspaceTypes. Please see the javadoc documentation for details. ItemListJson<WorkspaceInfoJson> itemListJson = workspaces.ListRoomsV30(null, true, true, false, false);
Resource.Workspaces workspaces = apiSession.GetWorkspacesResource(); // This returns a folder object, which contains details about the current workspace, // as well as a sub folder list that can be iterated over. FolderJson folderJson = workspaces.GetFolderTreeV30(roomId, null); List<FolderJson> subFolders = folderJson.SubFolders;