ListWorkspaces() public method

List all Workspaces.

It mirrors To the following Smartsheet REST API method: GET /Workspaces

This operation supports pagination of results. For more information, see Paging.
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 ListWorkspaces ( PaginationParameters paging ) : PaginatedResult
paging Smartsheet.Api.Models.PaginationParameters
return PaginatedResult
Example #1
0
        public virtual void TestListWorkspaces()
        {
            server.setResponseBody("../../../TestSDK/resources/listWorkspaces.json");

            IList <Workspace> workspace = workspaceResources.ListWorkspaces();

            Assert.AreEqual(7, workspace.Count);
            Assert.AreEqual(995897522841476L, (long)workspace[0].ID);
            Assert.AreEqual("Bootcamp Company", workspace[0].Name);
            Assert.AreEqual(AccessLevel.OWNER, workspace[0].AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?lx=asdsa", workspace[0].Permalink);
        }
        public virtual void TestListWorkspaces()
        {
            server.setResponseBody("../../../TestSDK/resources/listWorkspaces.json");

            PaginatedResult <Workspace> result = workspaceResources.ListWorkspaces(null);

            Assert.AreEqual(2, result.TotalCount);
            Assert.AreEqual(3457273486960516, (long)result.Data[0].Id);
            Assert.AreEqual("workspace 1", result.Data[0].Name);
            Assert.AreEqual(AccessLevel.OWNER, result.Data[0].AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?lx=JLiJbgXtXc0pzni9tzAKiR", result.Data[1].Permalink);
        }