Creating a Document
This example shows you how to create a document. Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/DocMgmt/Documents HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "TestDoc1",
"Description": "TestDoc1_Description",
"Title": "TestDoc1_Title",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48788507')"
}
Example: Creating a Document with Security Labels
This example shows you how to create a document with security labels. In this example, two standard security label attributes, SecrecyLabel and SL10, one custom security label attribute NTK, and one multi-valued security label attribute ExportControl are specified in the request body along with the other attributes.
* 
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/Documents HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"Name": "TestDoc1",
"Description": "TestDoc1_Description",
"Title": "TestDoc1_Title",
"SecrecyLabel": "Secret",
"SL10": "v1",
"NTK": "value1",
"ExportControl": "US_ITAR,UK_ITAR",
"Context@odata.bind": "Containers('OR:wt.pdmlink.PDMLinkProduct:48788507')"
}
这对您有帮助吗?