Batch Create Workspaces
post
/primeapi/restapi/workspace/batch
Send a request to this endpoint to create one or more workspaces.
Request
Supported Media Types
- application/json
One or more workspace objects.
Nested Schema : ApiEntityWorkspace
Type:
Show Source
object-
description(optional):
string
Summary of the workspace.
-
image(optional):
object ApiEntityWorkspaceImage
-
isProduction(optional):
boolean
Read Only:
trueIndicates a workspace that is in production.
All workspaces created under the Production workspace are automatically designated as production.
This cannot be changed. -
isSysGenerated(optional):
boolean
Read Only:
trueIndicates a workspace that was created by the system.
System generated workspaces cannot be deleted. -
link(optional):
string(url)
Read Only:
true -
parentWorkspace(optional):
integer(int64)
The unique identifier of the workspace hierarchically above another workspace.
-
securityGuid(optional):
string
The Globally Unique Identifier of the workspace.
-
sequenceNumber(optional):
integer(int32)
Determines the order of appearance of workspaces in a list.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceAutonumSettings(optional):
array workspaceAutonumSettings
Unique Items Required:
trueAn object containing workspace autonumber settings. -
workspaceCode(optional):
string
Workspace Code.
-
workspaceId(optional):
integer(int64)
The unique identifier of a workspace.
-
workspaceName(optional):
string
Name of a workspace.
-
workspaceSettings(optional):
array workspaceSettings
Unique Items Required:
trueAn object containing workspace settings.
Nested Schema : ApiEntityWorkspaceImage
Type:
Show Source
object-
image(optional):
array image
An image object represented in binary format.
-
imageType:
string
Allowed Values:
[ "PNG", "JPEG", "GIF" ]The file type of the image. Valid values are PNG, JPEG, and GIF. -
link(optional):
string(url)
Read Only:
true -
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId:
integer(int64)
The unique identifier of the workspace that contains this image.
-
workspaceImageId:
integer(int64)
The unique identifier of the image.
Nested Schema : workspaceAutonumSettings
Type:
arrayUnique Items Required:
trueAn object containing workspace autonumber settings.
Show Source
Nested Schema : workspaceSettings
Type:
arrayUnique Items Required:
trueAn object containing workspace settings.
Show Source
Nested Schema : ApiEntityWorkspaceAutonumSetting
Type:
Show Source
object-
area(optional):
string
Allowed Values:
[ "IDEA", "ACTIVITY", "ACTIVITY_ASSIGNMENT", "SCOPE_ITEM", "SCOPE_ASSIGNMENT", "CHANGE_ITEM", "WORK_PACKAGE", "CHANGE_REQUEST", "CONTRACT", "COMMITMENT", "BUDGET_CHANGE", "BUDGET_TRANSFER", "CHANGE_ORDER", "POTENTIAL_CHANGE_ORDER", "PAYMENT_APPLICATION", "RISK", "ACTUALS", "WORK_MANAGER_TASK", "SUBMITTAL", "CHANGE_EVENT", "RFI", "CUSTOM_LOGS_ITEM" ]Identifies the type of object used for auto numbering. -
autonumId(optional):
integer(int64)
The unique identifier of an auto numbering sequence.
-
link(optional):
string(url)
Read Only:
true -
name(optional):
string
Name of the auto numbering sequence.
-
prefix(optional):
string
Initial characters for the workspace auto numbering sequence.
-
suffix(optional):
string
The first number in the workspace auto numbering sequence.
-
suffixIncrement(optional):
integer(int32)
Number by which the auto numbering suffix is incremented.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId(optional):
integer(int64)
The unique identifier of a workspace.
Nested Schema : ApiEntityWorkspaceSetting
Type:
Show Source
object-
link(optional):
string(url)
Read Only:
true -
settingName:
string
Name of a workspace setting.
-
settingValue:
string
Value of a workspace setting.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId:
integer(int64)
The unique identifier of a workspace setting.
-
workspaceSettingId:
integer(int64)
The unique identifier of a workspace setting.
Response
Supported Media Types
- application/json
201 Response
The object was successfully created.
Nested Schema : ApiEntityWorkspace
Type:
Show Source
object-
description(optional):
string
Summary of the workspace.
-
image(optional):
object ApiEntityWorkspaceImage
-
isProduction(optional):
boolean
Read Only:
trueIndicates a workspace that is in production.
All workspaces created under the Production workspace are automatically designated as production.
This cannot be changed. -
isSysGenerated(optional):
boolean
Read Only:
trueIndicates a workspace that was created by the system.
System generated workspaces cannot be deleted. -
link(optional):
string(url)
Read Only:
true -
parentWorkspace(optional):
integer(int64)
The unique identifier of the workspace hierarchically above another workspace.
-
securityGuid(optional):
string
The Globally Unique Identifier of the workspace.
-
sequenceNumber(optional):
integer(int32)
Determines the order of appearance of workspaces in a list.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceAutonumSettings(optional):
array workspaceAutonumSettings
Unique Items Required:
trueAn object containing workspace autonumber settings. -
workspaceCode(optional):
string
Workspace Code.
-
workspaceId(optional):
integer(int64)
The unique identifier of a workspace.
-
workspaceName(optional):
string
Name of a workspace.
-
workspaceSettings(optional):
array workspaceSettings
Unique Items Required:
trueAn object containing workspace settings.
Nested Schema : ApiEntityWorkspaceImage
Type:
Show Source
object-
image(optional):
array image
An image object represented in binary format.
-
imageType:
string
Allowed Values:
[ "PNG", "JPEG", "GIF" ]The file type of the image. Valid values are PNG, JPEG, and GIF. -
link(optional):
string(url)
Read Only:
true -
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId:
integer(int64)
The unique identifier of the workspace that contains this image.
-
workspaceImageId:
integer(int64)
The unique identifier of the image.
Nested Schema : workspaceAutonumSettings
Type:
arrayUnique Items Required:
trueAn object containing workspace autonumber settings.
Show Source
Nested Schema : workspaceSettings
Type:
arrayUnique Items Required:
trueAn object containing workspace settings.
Show Source
Nested Schema : ApiEntityWorkspaceAutonumSetting
Type:
Show Source
object-
area(optional):
string
Allowed Values:
[ "IDEA", "ACTIVITY", "ACTIVITY_ASSIGNMENT", "SCOPE_ITEM", "SCOPE_ASSIGNMENT", "CHANGE_ITEM", "WORK_PACKAGE", "CHANGE_REQUEST", "CONTRACT", "COMMITMENT", "BUDGET_CHANGE", "BUDGET_TRANSFER", "CHANGE_ORDER", "POTENTIAL_CHANGE_ORDER", "PAYMENT_APPLICATION", "RISK", "ACTUALS", "WORK_MANAGER_TASK", "SUBMITTAL", "CHANGE_EVENT", "RFI", "CUSTOM_LOGS_ITEM" ]Identifies the type of object used for auto numbering. -
autonumId(optional):
integer(int64)
The unique identifier of an auto numbering sequence.
-
link(optional):
string(url)
Read Only:
true -
name(optional):
string
Name of the auto numbering sequence.
-
prefix(optional):
string
Initial characters for the workspace auto numbering sequence.
-
suffix(optional):
string
The first number in the workspace auto numbering sequence.
-
suffixIncrement(optional):
integer(int32)
Number by which the auto numbering suffix is incremented.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId(optional):
integer(int64)
The unique identifier of a workspace.
Nested Schema : ApiEntityWorkspaceSetting
Type:
Show Source
object-
link(optional):
string(url)
Read Only:
true -
settingName:
string
Name of a workspace setting.
-
settingValue:
string
Value of a workspace setting.
-
updateDate(optional):
string(date-time)
Read Only:
trueDate when the record was last updated. Used for viewing and filtering records, obtained ONLY from GET calls, modified on and after a particular date. Not a part of POST response. -
workspaceId:
integer(int64)
The unique identifier of a workspace setting.
-
workspaceSettingId:
integer(int64)
The unique identifier of a workspace setting.
400 Response
Invalid input.
Examples
The following examples show how to use the API to create workspaces.
Using cURL
Use cURL command line options to form and submit a request to the Prime server.
cURL Command
curl -X GET -H "Accept:application/json" -u "Molly Abraham:password123" -d "[{\"parentWorkspace\":1, \"workspaceCode\":\"s000\", \"workspaceName\":\"Dig Excavation\"},{\"parentWorkspace\":1, \"workspaceCode\":\"e000\", \"workspaceName\":\"Harbor Renovation\"}]" https://localhost:7001/primeapi/restapi/workspace/batch
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 requestDate = JSON.stringify([{
"parentWorkspace": 1,
"workspaceCode": "s000",
"workspaceName": "Dig Excavation"
},{
"parentWorksapce": 1,
"workspaceCode": "e000",
"workspaceName": "Harbor Renovation"
}]);
var options = {
hostname: "localhost",
port: 7001,
method: 'POST',
path: "/primeapi/restapi/workspace/batch",
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": "57D2016A48BA7BBBE05394B8580AE7A6",
"workspaceSettings": [{
"workspaceSettingId": 59056,
"settingName": "ScopeAssignmentCodeCurrentSuffix",
"settingValue": "0",
"workspaceId": 33001
}, {
"workspaceSettingId": 59009,
"settingName": "ScheduleCheck.Relationship",
"settingValue": "Y",
"workspaceId": 33001
}
//...more workspaceSettings objects
],
"parentWorkspace": 1,
"workspaceCode": "s000",
"workspaceId": 33001,
"workspaceName": "Dig Excavation",
"sequenceNumber": 1530,
"workspaceAutonumSettings": [{
"autonumId": 49014,
"suffix": "10",
"workspaceId": 33001,
"suffixIncrement": 1,
"prefix": "WP"
}, {
"autonumId": 49001,
"suffix": "10",
"workspaceId": 33001,
"suffixIncrement": 1,
"prefix": "CBT"
}
//...more workspaceAutonumSettings objects
]
}, {
"securityGuid": "57D2016A48BB7BBBE05394B8580AE7A6",
"workspaceSettings": [{
"workspaceSettingId": 59167,
"settingName": "ScheduleCheck.NegativeFloat",
"settingValue": "Y",
"workspaceId": 33002
}, {
"workspaceSettingId": 59180,
"settingName": "ScheduleCheck.SoftConstraintsTarget",
"settingValue": "5",
"workspaceId": 33002
}
//...more workspaceSettings objects
],
"parentWorkspace": 1,
"workspaceCode": "e000",
"workspaceId": 33002,
"workspaceName": "Harbor Renovation",
"sequenceNumber": 1530,
"workspaceAutonumSettings": [{
"autonumId": 49037,
"suffix": "1000",
"workspaceId": 33002,
"suffixIncrement": 10,
"prefix": "A"
}, {
"autonumId": 49022,
"suffix": "10",
"workspaceId": 33002,
"suffixIncrement": 1,
"prefix": "WP"
}
//...more workspaceAutonumSettings objects
]
}
]