docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Use case: Read the download url for a file attachment of an annotation

    Before you start

    Before you retrieve a download URL for a file attachment, ensure you have completed the following prerequisites:

    1. Verify Permissions: Confirm that you have the necessary rights to access the attachment. This typically requires having read access to the annotation containing the attachment.
    2. Identify the Attachment: Have the unique identifier of the specific attachment you need to download. You'll need this to request the correct download URL.
    3. Understand URL Expiration: Be aware that download URLs provided by the Collaboration system are typically temporary and expire after a certain period (usually 24 hours or less). They should be used promptly rather than stored long-term.
    4. Storage Considerations: Ensure you have sufficient local storage if you plan to download large files, especially when implementing batch download functionality.
    5. Set Up SDK Environment: Ensure your Unity environment is properly configured with the Collaboration SDK to interact with the annotation system.

    How do I...?

    Get a download URL for a specific attachment

    To retrieve a download URL for an identified attachment:

    1. Obtain the Project Identifier: Ensure you have the correct project identifier (GUID) for the project.
    2. Obtain the Asset Identifier: Ensure you have the correct and complete asset identifier (GUID) for the asset.
    3. Obtain the Attachment ID: Ensure you have the unique identifier for the specific attachment you want to get the download url for.
    4. Request the Download URL: Use the SDK to request a temporary download URL for the attachment.
    5. Use the URL Promptly: Remember that the download URL has a limited validity period.

    Example:

    var response = await annotationManagement.ReadAnnotationFileAttachmentDownloadUrlAsync(
      projectId: projectId,
      annotationId: annotationId,
      attachmentId: attachmentId,
      cancellationToken: cancellationToken);
    
    var downloadUrl = response.Url;
    

    For more information on working with attachments, see the documentation on creating attachments and updating attachments.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)