Importing a Package
You can import administrative changes for any of the created or updated object types that are supported for business administrative change promotion.
The following example demonstrates how to import and upload a change package. The process is a three-stage process.
Stage 1 URI (ImportStage1Action)
Use the following POST URI with the request body:
POST /Windchill/servlet/odata/BACMgmt/ImportStage1Action HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"@odata.context": "$metadata#CacheDescriptor",
"value": [
{
"FileNames": [
14016
],
"FolderId": 174212,
"ID": null,
"MasterUrl": "http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW",

"ReplicaUrl":""http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW/wt.fv.uploadtocache.DoUploadToCache_Server/doUploadToCache_Master?mk=wt.fv.uploadtocache.DoUploadToCache_Server&VaultId=174204&FolderId=174212&CheckSum=28032&sT=1602256367&sign=UfKy3j1ZLIx4MrwdEeAirA%3D%3D&site=http%3A%2F%2Fpwdcsv-wcqa73d.ptcnet.ptc.com%2FWindchill%2Fservlet%2FWindchillGW&AUTH_CODE=HmacMD5&isProxy=true&delegate=wt.fv.uploadtocache.DefaultRestFormGeneratorDelegate",
"StreamIds": [
14016
],
"VaultId": 174204
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Calcutta"
}
Response
{
"@odata.context": "$metadata#CacheDescriptor",
"value": [
{
"FileNames": [
14018
],
"FolderId": 174212,
"ID": null,
"MasterUrl": "http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW",
"ReplicaUrl":""http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW/wt.fv.uploadtocache.DoUploadToCache_Server/doUploadToCache_Master?mk=wt.fv.uploadtocache.DoUploadToCache_Server&VaultId=174204&FolderId=174212&CheckSum=28032&sT=1602256367&sign=UfKy3j1ZLIx4MrwdEeAirA%3D%3D&site=http%3A%2F%2Fpwdcsv-wcqa73d.ptcnet.ptc.com%2FWindchill%2Fservlet%2FWindchillGW&AUTH_CODE=HmacMD5&isProxy=true&delegate=wt.fv.uploadtocache.DefaultRestFormGeneratorDelegate",
"StreamIds": [
14018
],
"VaultId": 174204
}
],
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Calcutta"
}
Stage 2 URI (DoUploadToCache_Server)
Use the following POST URI with the request body:
POST /Windchill/servlet/WindchillGW/wt.fv.uploadtocache.DoUploadToCache_Server/doUploadToCache_Master?mk=wt.fv.uploadtocache.DoUploadToCache_Server&VaultId=174204&FolderId=174212&CheckSum=28036&sT=1602257098&sign=4SSoglkeOUMz2%2FXQz4tFnA%3D%3D&site=http%3A%2F%2Fpwdcsv-wcqa73d.ptcnet.ptc.com%2FWindchill%2Fservlet%2FWindchillGW&AUTH_CODE=HmacMD5&isProxy=true&delegate=wt.fv.uploadtocache.DefaultRestFormGeneratorDelegate HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body (form data)
Master_URL: http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW
CacheDescriptor_array: 14018:14018:14018 14018 - OIR_5087-vm2 2020-10-08-05-47-08_PTC BAC Target_0000000022.zip
Response
{
"contentInfos": [
{
"streamId": 14018,
"fileSize": 61065,
"encodedInfo": "14018%3A61065%3A174212%3A14018"
}
]
}
Stage 3: Import (ImportStage3Action)
Use the following POST URI with the request body:
POST /Windchill/servlet/odata/BACMgmt/ImportStage3Action HTTP/1.1
Request Headers
Content-Type: application/json
CSRF_NONCE: <Use the value from Fetch NONCE example>
Request Body
{
"ContentInfo": [
{
"FileName": "OIR_5087-vm2 2020-10-08-05-47-08_PTC BAC Target_0000000022.zip",
"PrimaryContent": true,
"StreamId": 14018,
"EncodedInfo": "14018%3A61065%3A174212%3A14018",
"FileSize": 61065,
"MimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
],
"UseBundledMappings": false,
"UseBundledResolutions": false
}
Response
{
"@odata.context": "http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/odata/v3/PTC/$metadata#PTC.BACMgmt.ImportResponse",
"@PTC.AppliedContainerContext.LocalTimeZone": "Asia/Calcutta",
"Message": "Package could not be imported. Please contact Administrator for further details.",
"ReportDownloadUrl": {
"URL": "http://pwdcsv-wcqa73d.ptcnet.ptc.com/Windchill/servlet/WindchillGW/wt.fv.master.StandardMasterService/doDirectDownload/OIR_5087-vm2%202020-10-08-05-47-08_0000000004_1.html?folderId=174225&ft=FF&userid=12&adId=193453&fileName=0000000000372a&refsize=803&mime=text/html&mk=wt.fv.master.StandardMasterService&ofn=OIR_5087-vm2%202020-10-08-05-47-08_0000000004_1.html&c=36&riid=-1&sT=1602258138&sign=o7GBOKHeqlqLrOPqdilEfQ%3D%3D&site=http%3A%2F%2Fpwdcsv-wcqa73d.ptcnet.ptc.com%2FWindchill%2Fservlet%2FWindchillGW&AUTH_CODE=HmacMD5&isProxy=true",
"Label": "Please refer the import report for more details: "
},
"ImportSuccessful": false
}