Overview
Adds a new revision to an existing PM Attachment. The parent document is identified by its UUID in the path, and the uploaded file is stored as its newest revision. The revision number is assigned by CMiC and cannot be supplied by the caller.
Object links already on the parent document are left untouched, so the document stays attached to whatever it was linked to before.
Request Payload
This request is sent as multipart/form-data.
document-content-file(file, required): The file to store as the new revision. If this part is missing, the request fails withPM-000217-ERR.fileDetails(text, optional): JSON metadata for the new revision. The part may be omitted or left blank, in which case the revision is created from the uploaded file alone. Unrecognized fields are ignored. Every field below is optional:PmdrComment(string): Comment recorded against the revision.PmdrRevDate(string): Revision date, inYYYY-MM-DDformat.PmdrRcvdDate(string): Received date, inYYYY-MM-DDformat.
Response payload
On success, the response is JSON describing the revision that was created:
Result(string): AlwaysRevision Added Successfully.PmdRevUuid(string): UUID of the new revision.PmdRevNum(string): Revision number assigned by CMiC.PmdRevOraseq(string): Internal sequence number of the new revision.PmdUuid(string): UUID of the parent PM Attachment.PmdId(string): Document ID of the parent PM Attachment.PmdTitle(string): Existing title of the document. Adding a revision does not change it.
Fields with no value are omitted from the response.
Errors return the standard error payload: uuid, status, errorCode, errorMessage, timestamp, and moreDetails.
HTTP response statuses
200 OK: The revision was created.400 Bad Request: The request was rejected before any revision was created. The specific cause is inerrorCode:PM-000222-ERR: No document UUID was supplied in the path.PM-000217-ERR: Thedocument-content-filepart is missing from the request.PM-000228-ERR: No document exists for the supplied UUID.PM-000224-ERR: The document exists but is not a PM Attachment, so it is not linked to a project.PM-000227-ERR: The user does not have rights to create documents of this type.
401 Unauthorized: The user lacks the required access. On these responses the PM code is returned inerrorMessagerather thanerrorCode:PM-000233-ERR: The user has no menu access to Documents.PM-000234-ERR: The user has no accessible document types.PM-000235-ERR: The document's type is not in the user's editable document types.PM-000237-ERR: The user has no program access to the Document Log.
500 Internal Server Error: The revision could not be created, for example becausefileDetailswas not valid JSON, the file could not be written, or the database call failed. Any partially written file is removed and the transaction is rolled back.
Basic authentication
Optional JSON metadata for the new revision. Accepts PmdrComment, PmdrRevDate and PmdrRcvdDate, all optional. May be omitted or left blank.
Required. The file to store as the new revision. If it is missing, the request fails with PM-000217-ERR.
OK
{
"Result": "Revision Added Successfully",
"PmdRevUuid": "0164DED6D2E448EAE06316821FAC3745",
"PmdRevNum": "1",
"PmdRevOraseq": "842843701",
"PmdUuid": "0164DED6D2E048EAE06316821FAC3745",
"PmdId": "DOC-100000001",
"PmdTitle": "Site Plan"
}Bad Request
PM-000217 - Document Content File Required
{
"uuid": "00000000-0000-0000-0000-000000000000",
"status": "Error",
"errorCode": "PM-000217-ERR",
"errorMessage": "document-content-file part of multi-part upload is required",
"timestamp": "2025-02-01 00:00:00.000",
"moreDetails": {
"ecid": "00000000-0000-0000-0000-000000000000-00000000"
}
}PM-000228 - Document Not Found
{
"uuid": "00000000-0000-0000-0000-000000000000",
"status": "Error",
"errorCode": "PM-000228-ERR",
"errorMessage": "No document found for the supplied uuid",
"timestamp": "2025-02-01 00:00:00.000",
"moreDetails": {
"ecid": "00000000-0000-0000-0000-000000000000-00000000"
}
}PM-000227 - Insufficient Rights
{
"uuid": "00000000-0000-0000-0000-000000000000",
"status": "Error",
"errorCode": "PM-000227-ERR",
"errorMessage": "User does not have rights to create documents of this type",
"timestamp": "2025-02-01 00:00:00.000",
"moreDetails": {
"ecid": "00000000-0000-0000-0000-000000000000-00000000"
}
}