Use case: Finalize an attachment in an annotation
The finalization process of an attachment is to notify the server that the attachment's file content has been successfully uploaded.
It is a necessary step before the attachment can be used in an annotation, only for attachments of type FileAttachment and SketchAttachment.
Before you start
Before you read an attachment, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to modify annotations.
- Existing Annotation: You must have an existing annotation containing the attachment to finalize.
- Existing Attachment's identifier: You must have the ID of an existing attachment of type
FileAttachmentandSketchAttachmentto finalize.
How do I...?
Finalize an attachment
Invoke the FinalizeAnnotationAttachmentAsync method to finalize an attachment.
The following input parameters are required:
projectId: The ID of the project.annotationId: The ID of the annotation.attachmentId: The ID of the attachment to finalize.fileName: The name of the file to finalize.
var fileAttachmentId = new AttachmentId("<file-attachment-id>");
await User1Manager.AnnotationManagement.FinalizeAnnotationAttachmentAsync(projectId, annotationId, attachmentId, fileName);
For more information on working with attachments, see the documentation on creating attachments, updating attachments and deleting attachments.
See the API documentation for more details on the FinalizeAnnotationAttachmentAsync method.