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

CreateWorkspace() public method

Create a workspace.

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

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 CreateWorkspace ( Api.Models.Workspace workspace ) : Api.Models.Workspace
workspace Api.Models.Workspace the workspace To create
return Api.Models.Workspace
        public virtual Workspace CreateWorkspace(Workspace workspace)
        {
            return this.CreateResource<Workspace>("workspaces", typeof(Workspace), workspace);
        }

Usage Example

        public virtual void TestCreateWorkspace()
        {
            server.setResponseBody("../../../TestSDK/resources/createWorkspace.json");

            Workspace workspace    = new Workspace.CreateWorkspaceBuilder("New workspace").Build();
            Workspace newWorkspace = workspaceResources.CreateWorkspace(workspace);

            Assert.AreEqual(7960873114331012, (long)newWorkspace.Id);
            Assert.AreEqual("New workspace", newWorkspace.Name);
            Assert.AreEqual(AccessLevel.OWNER, newWorkspace.AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?lx=rBU8QqUVPCJ3geRgl7L8yQ", newWorkspace.Permalink);
        }
All Usage Examples Of Smartsheet.Api.Internal.WorkspaceResourcesImpl::CreateWorkspace