Use case: Get Threads count by target within a project
Before you start
Before you make a request to get threads count, 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.
- 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 detailed counts for threads across multiple targets
To get detailed counts of threads for a group of targets/sub-targets:
- 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 detailed counts for threads across multiple targets/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.
- Set Pagination Parameters: Optionally, you can specify offset and limit to paginate the result. These parameters help control how many targets are skipped and the maximum number of targets returned.
Example:
var result = await annotationManagement.ThreadsCountByTargetAsync(
projectId: projectId,
target: target,
offset: offset,
limit: limit,
cancellationToken: cancellationToken);
var targets = result.Targets;
Targets are represented by a list of objects, where each object contains:
- Target: The path of the target or sub-target within the project.
- Count: The number of threads associated with that specific target.
{
"targets": [
{ "target": "assets/projects/{projectId}/assets/{assetId}", "count": 25 },
{ "target": "assets/projects/{projectId}/assets/{assetId}/subtarget1", "count": 17 }
]
}
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.