GetWorkspace() public method

Gets the specified Workspace (and lists its contents).

It mirrors To the following Smartsheet REST API method: GET /workspaces/{workspaceid}

By default, this operation only returns the top-level items in the Workspace. To load all of the contents, including nested Folders, include the loadAll query string parameter with a value of true.

If no Folders, Sheets, Reports, or Templates are present in the Workspace, the corresponding attribute (e.g., "folders", "sheets") will not be present in the response object.

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public GetWorkspace ( long workspaceId, bool loadAll, IEnumerable include ) : Api.Models.Workspace
workspaceId long the workspace id
loadAll bool Defaults to false. If true, loads all of the contents, including nested Folders.
include IEnumerable When specified with a value of "source", response will include the source for any sheet that was created from another sheet or template
return Api.Models.Workspace
Example #1
0
        public virtual void TestGetWorkspace()
        {
            server.setResponseBody("../../../TestSDK/resources/getWorkspace.json");

            Workspace workspace = workspaceResources.GetWorkspace(1234L);

            Assert.AreEqual(995897522841476L, (long)workspace.ID);
            Assert.AreEqual("Bootcamp Company", workspace.Name);
            Assert.AreEqual(0, workspace.Sheets.Count);
            Assert.AreEqual(2, workspace.Folders.Count);
            Assert.AreEqual(AccessLevel.OWNER, workspace.AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?asdf", workspace.Permalink);
        }
        public virtual void TestGetWorkspace()
        {
            server.setResponseBody("../../../TestSDK/resources/getWorkspace.json");

            Workspace workspace = workspaceResources.GetWorkspace(1234L, false, null);

            Assert.AreEqual(7116448184199044, (long)workspace.Id);
            Assert.AreEqual("New workspace", workspace.Name);
            Assert.AreEqual(1, workspace.Sheets.Count);
            Assert.AreEqual(null, workspace.Folders);
            Assert.AreEqual(AccessLevel.OWNER, workspace.AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?lx=8Z0XuFUEAkxmHCSsMw4Zgg", workspace.Permalink);
        }