Use case: Find replies to an annotation
Before you start
Before you find replies to an annotation, ensure you have completed the following prerequisites:
- Verify Permissions: Check that you have the necessary access rights to view annotations and their replies within your project.
- Obtain the Annotation ID: Ensure you have the unique identifier of the parent annotation for which you want to find replies. This ID is essential for querying related responses.
- Understand the Relationship Model: Familiarize yourself with how annotation replies are organized in the system. Replies are typically linked to a parent annotation through a reference relationship.
- Set Up SDK Environment: Make sure your Unity Editor environment is properly configured with the Collaboration SDK to access annotation data.
How do I...?
Find all replies to a specific annotation
To retrieve all replies associated with a particular annotation, follow these steps:
- Identify the Parent Annotation: Determine which annotation's replies you need to find. You'll need its unique identifier.
- Query for Replies: Use the SDK to fetch all replies linked to the parent annotation.
- Handle Empty Results: Implement appropriate handling for cases where no replies exist for the annotation.
- Process the Results: Format and display the retrieved replies in your application's user interface.
Example:
ReadRepliesResult result = await annotationManagement.ReadRepliesAsync(projectId, annotationId, cancellationToken: cancellationToken);
Filter and sort annotation replies
To refine the list of replies to retrieve:
- Apply Filtering Options: Use filtering parameters to narrow down the replies based on criteria such as:
- Creation date range
- Creator information
- Content keywords
- Annotation status ("All","Active","Sending","Draft")
- Sort Results: Organize replies in a meaningful order:
- Chronological (newest/oldest first)
- By user
- By relevance (if supported)
Implement pagination for large result sets
When dealing with annotations that might have many replies:
- Set Page Size: Determine how many replies to retrieve per request.
- Implement Page Navigation: Add functionality to navigate through pages of replies.
- Track Position: Maintain the current position in the result set to enable seamless browsing.
Note
Pagination helps optimize performance when dealing with threads that contain many replies by loading only what is needed at any given time.
For more comprehensive thread management, see the documentation on thread subscription and thread unsubscription.