Use case: Get Threads count by target in annotations within a project
Before you start
Before you make a request to get threads count in annotations, ensure you have completed the following prerequisites:
- Verify Permissions: Confirm that you have the necessary rights to read threads information. This typically requires basic read permissions for the collaboration system.
- Identify the Thread: You must have a valid target identifier to check threads count in annotations.
- Set Up SDK Environment: Ensure your Unity environment is properly configured with the Collaboration SDK to interact with the collaboration system.
How do I...?
Get the total count of threads in annotations matching a target
To get count of the threads in annotations by target:
- Obtain the Project Identifier: Ensure you have the correct project identifier (GUID) for the project.
- Obtain the Target Identifier: Ensure you have the correct target identifier. Glob-like partial matching on the Target field is supported. This supports partial matching by using a wildcard (**) at the end of the target path. For example, retrieving all threads count with sub-targets within a project can be done with:
assets/projects/{projectId}/assets/{assetId}/**
Important limitations:- The wildcard must be at the end of the path.
- Full wildcard within the path is not supported.
Example:
var result = await annotationManagement.ThreadsCountInAnnotationsByTargetAsync(
projectId: projectId,
target: target,
cancellationToken: cancellationToken);
var count = result.Count;
The count represents the total number of threads in annotations matching the specified target.
For more information on working with threads, see the documentation on subscribe a user to a thread, unsubscribe a user from a thread, check a user subscription to a thread and get Threads count by target in annotations in project.