Windchill REST Services > Windchill REST Services Domain Capabilities > PTC Domains > PTC Common Domain > Actions Available in the PTC Common Domain
  
Actions Available in the PTC Common Domain
The following action is available in the PTC Common domain:
DownloadContentAsZip
* 
The action is available in the version 4 or later of the PTC domain.
To execute the action for a domain that inherits the ContentHolder entity, the latest version of the domain must import version 4 or later of the PTC domain.
The unbound action, DownloadContentAsZip, downloads the content items of the ApplicationData type for a specified single or multiple content holder entities as a zip-stream. The created zip-stream includes the content items for each content holder based on the information specified in the DownloadContentInfo complex types in the request body. The request parameter, DownloadContentInfos, is a collection of a single or multiple DownloadContentInfo complex types.
The DownloadContentInfo complex type defines the properties described in the following table:
Property
Description
Required
ContentHolder@odata.bind
The content holder ID.
ContentHolder@odata.bind defines the ContentHolder entity as a navigation property with @odata.bind.
* 
Only the entities that inherit the contentHolder delegate are supported.
Yes
ContentNavigationProperty
Comma-separated list of navigation properties that hold the content that you want to download.
ContentNavigationProperty is a collection of a single or multiple navigation properties.
* 
Only the navigation properties that are available in the inheriting entity are supported.
For example, you can download the content for the following navigation properties: Thumbnails, SmallThumbnails, Attachments, AdditionalFiles, and so on.
* 
Only AdditionalFiles is supported for representations.
PrimaryContent is not supported for CAD documents.
Yes
ContentFormatFilter
Comma-separated list of file extensions to filter. The created zip-stream includes only the files with the extensions that are specified in the attribute value.
ContentFormatFilter is a collection of a single or multiple file extensions to filter.
Optional
ContentNameSuffix
The suffix to add to a file to rename its file name. When specified, the files that are added to the zip-stream are renamed in the <FileName>_<ContentNameSuffix>.extension format.
When multiple files are downloaded, the specified suffix is added to all file names in the zip-stream.
Optional
EntityVersion
The domain version of the content holder entity.
Optional
The response includes the following headers:
Content-Disposition: attachment; filename=Contents.zip
Content-Type: application/octet-stream
The following example shows you how to specify the DownloadContentInfos request body to download content items for the content holder entities as a zip-stream. In this example, the ContentHolder entities of the document, part, CAD document, and representation types that inherit the contentHolder delegate are specified in the request body.
Use the following POST URI with the request body.
URI
POST /Windchill/servlet/odata/DocMgmt/DownloadContentAsZip
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"DownloadContentInfos": [
{
"ContentHolder@odata.bind": "PTC.DocMgmt.Documents('OR:wt.doc.WTDocument:182147')",
"ContentNavigationProperty": ["PrimaryContent","Attachments"],
"EntityVersion": 6
},
{
"ContentHolder@odata.bind": "PTC.ProdMgmt.Parts('OR:wt.part.WTPart:212435')",
"ContentNavigationProperty": ["Attachments"]
},
{
"ContentHolder@odata.bind": "PTC.CADDocumentMgmt.CADDocuments('OR:wt.epm.EPMDocument:114533')",
"ContentNavigationProperty": ["Attachments"]
},
{
"ContentHolder@odata.bind": "PTC.Visualization.Representations('OR:wt.viewmarkup.DerivedImage:138819')",
"ContentNavigationProperty": ["AdditionalFiles"],
"ContentFormatFilter": ["PVT","JPG"],
"ContentNameSuffix": "100_IN_WORK"
}
]
}