Create a Workspace

post

/primeapi/restapi/workspace

Send a request to this endpoint to create a workspace.

Request

Supported Media Types
Body ()
A workspace object.
Root Schema : ApiEntityWorkspace
Type: object
Show Source
Nested Schema : ApiEntityWorkspaceImage
Type: object
Show Source
Nested Schema : workspaceAutonumSettings
Type: array
Unique Items Required: true
An object containing workspace autonumber settings.
Show Source
Nested Schema : workspaceSettings
Type: array
Unique Items Required: true
An object containing workspace settings.
Show Source
Nested Schema : image
Type: array
An image object represented in binary format.
Show Source
Nested Schema : ApiEntityWorkspaceAutonumSetting
Type: object
Show Source
Nested Schema : ApiEntityWorkspaceSetting
Type: object
Show Source

Response

Supported Media Types

201 Response

The object was successfully created.
Body ()
Root Schema : ApiEntityWorkspace
Type: object
Show Source
Nested Schema : ApiEntityWorkspaceImage
Type: object
Show Source
Nested Schema : workspaceAutonumSettings
Type: array
Unique Items Required: true
An object containing workspace autonumber settings.
Show Source
Nested Schema : workspaceSettings
Type: array
Unique Items Required: true
An object containing workspace settings.
Show Source
Nested Schema : image
Type: array
An image object represented in binary format.
Show Source
Nested Schema : ApiEntityWorkspaceAutonumSetting
Type: object
Show Source
Nested Schema : ApiEntityWorkspaceSetting
Type: object
Show Source

400 Response

Invalid input.

Examples

The following examples show how to use the API to create a workspace.

Using cURL

Use cURL command line options to form and submit a request to the Prime server.

cURL Command

curl -X POST -H "Accept:application/json" -u "Molly Abraham:password123" -d "{\"parentWorkspace\":1, \"workspaceName\":\"Infrastructure\", \"workspaceCode\":\"INF1\"}" https://localhost:7001/primeapi/restapi/v17.2/workspace

Using Node JS

Use the Node JS https class interface to form and send an HTTP request to the Oracle Prime API server. Write a Node JS script that forms and sends an HTTP request, then execute the script with node to interact with the server.

Node JS Script

var https = require('https'); 
      var requestData = JSON.stringify({ 
          "parentWorkspace":1, 
          "workspaceName":"Infrastructure", 
          "workspaceCode":"INF1" 
      }); 
      var options = { 
          hostname: "localhost", 
          port: 7001, 
          method: 'POST', 
          path: "/primeapi/restapi/v17.2/workspace", 
          auth: "Molly Abraham:password123" 
      } 
      var request = https.request(options, function(result){ 
          result.setEncoding('utf8'); 
          result.on('data', function(response){ 
              console.log(response); 
          }); 
      }); 
      request.write(requestData); 
      request.end();

Example Response

When the command executes, the Oracle Prime server returns an HTTP response of content-type application/json:

Example of Response Header

HTTP/1.1 200 OK
Date: Thu, 22 Dec 2016 19:04:45 GMT
Transfer-Encoding: chunked
Content-Type: application/json

Example of Response Body

{ 
      	"securityGuid": "56F4F09B212E07A5E05394B8580A40DB", 
      	"workspaceSettings": [{ 
      			"workspaceId": 31907, 
      			"workspaceSettingId": 55974, 
      			"settingName": "ChangeRequestCodeCurrentSuffix", 
      			"settingValue": "0" 
      		}, { 
      			"workspaceId": 31907, 
      			"workspaceSettingId": 55943, 
      			"settingName": "ScheduleCheck.ProgressDate", 
      			"settingValue": "Y" 
      		},  
      		//...more workspaceSettings objects 
      	], 
      	"parentWorkspace": 1, 
      	"workspaceCode": "INF1", 
      	"workspaceAutonumSettings": [{ 
      			"suffixIncrement": 1, 
      			"suffix": "10", 
      			"workspaceId": 31907, 
      			"autonumId": 47924, 
      			"prefix": "CR" 
      		}, { 
      			"suffixIncrement": 1, 
      			"suffix": "10", 
      			"workspaceId": 31907, 
      			"autonumId": 47927, 
      			"prefix": "SI" 
      		}, 
      		//...more workspaceAutonumSettings objects 
      	], 
      	"workspaceId":31907, 
      	"sequenceNumber":1440, 
      	"workspaceName":"Infrastructure" 
      }