Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Manufacturing Process Management Domain > Creating Multiple Work Centers
  
Creating Multiple Work Centers
You can create single or multiple Work Center objects using the CreateWorkCenters action. The following example shows how to create multiple Work Centers. Use the following POST request with the request body:
URI
POST /Windchill/servlet/odata/MfgProcMgmt/CreateWorkCenters HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"WorkCenters": [
{
"Latest": false,
"View": "Design",
"StopEffectivityPropagation": true,
"State": {},
"External": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:163170')",
"Name": "UIWorkCenter",
"Source": "make",
"DefaultUnit": "ea",
"Description": "des",
"Category": {
"Value": "WorkUnit"
},
"WorkInProgressState": {}
},
{
"Latest": false,
"View": "Design",
"StopEffectivityPropagation": false,
"State": {},
"External": false,
"Name": "UIWorkCenter2",
"Source": "make",
"DefaultUnit": "ea",
"Description": "des",
"Category": {
"Value": "WorkUnit"
},
"WorkInProgressState": {}
}
]
}
You can also assign single-valued or multi-valued Security Labels for single or multiple Work Centers.
Example: Assigning Single-valued Security Label for Multiple Work Centers
This example shows you how to create two Work Centers with single-valued security labels. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/CreateWorkCenters
Request Header
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"WorkCenters": [
{
"Name": "Work Center 1.3.1",
"DefaultUnit": "ea",
"Category": {
"Value": "Line"
},
"Source": "make",
"StopEffectivityPropagation": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:113009')",
"EXPORTCONTROL": "CUSTOM"
},
{
"Name": "Work Center 1.3.2",
"DefaultUnit": "ea",
"Category": {
"Value": "Line"
},
"Source": "make",
"StopEffectivityPropagation": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:113009')",
"EXPORTCONTROL": "LNC"
}
]
}
Example: Assigning Multi-valued Security Label for Multiple Work Centers
This example shows you how to create two Work Centers with multi-valued security labels. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/MfgProcMgmt/CreateWorkCenters
Request Header
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"WorkCenters": [
{
"Name": "Work Center 1.4.1",
"DefaultUnit": "ea",
"Category": {
"Value": "Line"
},
"Source": "make",
"StopEffectivityPropagation": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:113009')",
"EXPORTCONTROL": "LNC,CUSTOM"
},
{
"Name": "Work Center 1.4.2",
"DefaultUnit": "ea",
"Category": {
"Value": "Line"
},
"Source": "make",
"StopEffectivityPropagation": false,
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:113009')",
"EXPORTCONTROL": "LNC,CUSTOM"
}
]
}