Windchill REST Services > Windchill REST Services Domain Capabilities > Examples for Basic REST Operations > Examples for the PTC Document Management Domain > Creating Multiple Documents
  
Creating Multiple Documents
This example shows you how to create multiple documents. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/DocMgmt/CreateDocuments
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Documents": [
{ "Name": "test doc1", "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:302725')" }
,
{ "Name": "test doc2", "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:302725')" }
]
}
Similarly, you can create multiple classified documents by specifying the classification attributes for each specified document in the request body.
Example: Creating Multiple Documents with Security Labels
This example shows you how to create two Documents with security labels. In this example, two standard security label attributes, SecrecyLabel and SL10 along with other attributes are specified for each Document object in the request body.
* 
To set the values of the standard security label attributes that are available in the EDM of the entity, you must specify the internal names of their values in the request body.
You can specify unrestricted (standard and custom) or restricted security label attributes in the request body.
If restricted security label attributes are specified or if the access to an entity is restricted, the request creates the entity object in Windchill, but the response does not contain the entity.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/DocMgmt/CreateDocuments
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Documents": [
{ "Name": "MultiDocSL1111", "SecrecyLabel": "Secret1", "SL10": "v1", "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:302725')" }
,
{ "Name": "MultiDocSL2222", "SecrecyLabel": "Secret2", "SL10": "v1", "Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:302725')" }
]
}