Use case: Update an annotation
Before you start
Before you update an annotation, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to modify the annotation. Typically, you'll need to be the original creator of the annotation or have appropriate administrative permissions.
- Identify the Annotation: Locate the specific annotation you want to update. You'll need its unique identifier to perform this action.
- Determine Required Changes: Clearly identify which aspects of the annotation need to be updated.
Keep in mind that there are restrictions for the text content:
- Must be less than 10,000 characters
- Cannot be empty or contain only whitespace characters
- Cannot start or end with whitespace characters
How do I...?
Update the content of an annotation
To modify the text or main content of an existing annotation:
- Obtain the Project Identifier: Ensure you have the correct project identifier (GUID) for the project.
- Obtain the Annotation Identifier: Ensure you have the correct annotation identifier (GUID) for the annotation to amend.
- Modify the Content: Update the annotation content with new text.
- Handle Any Errors: Implement the appropriate error handling to manage cases where the update might fail.
Example:
var text = "Updated annotation content with new information.";
await annotationManagement.UpdateAnnotationAsync(
projectId: projectId,
annotationId: annotationId,
text: text,
cancellationToken: cancellationToken);
For more information on managing annotations, see the documentation on creating annotations and searching annotations.