Smartsheet.Api.Internal.WorkspaceResourcesImpl.ListWorkspaces C# (CSharp) Method

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
        public virtual PaginatedResult<Workspace> ListWorkspaces(PaginationParameters paging)
        {
            StringBuilder path = new StringBuilder("workspaces");
            if (paging != null)
            {
                path.Append(paging.ToQueryString());
            }
            return this.ListResourcesWithWrapper<Workspace>(path.ToString());
        }

Usage Example

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);
        }
All Usage Examples Of Smartsheet.Api.Internal.WorkspaceResourcesImpl::ListWorkspaces