Entity Attachments


An Entity Attachment is a linking record between a Client File and Entity. Attachments have corresponding Attachment Type records which let you define a level of categorization.

Some Attachment Types are used for our default panels, for example the Attachment Type "photo" will display the files in the "Media" tab when selecting Entities in Navigator.

You will find other Attachment Types appear under the 'Attachments' Selected Entity tab in Navigator. They will appear as folders of related Client Files.

Attachment Types requests

Below are the basic requests for managing Attachment Type records.

Get Attachment Types

Response
interface IResponse {
    Items: {
        // Attachment type description.
        Description: string;
        // Attachment type ID.
        ID: Type;
        // Human readable attachment type name.
        Name: string;
    }[];
}
Javascript example

Get Attachment Type by ID

Response
interface IResponse {
    // Attachment type description.
    Description: string;
    // Attachment type ID.
    ID: Type;
    // Human readable attachment type name.
    Name: string;
}
Javascript example

Create/Update Attachment Type

Response
interface IRequest {
    // Attachment type description.
    Description: string;
    // Attachment type ID.
    ID: Type;
    // Human readable attachment type name.
    Name: string;
}

Delete Attachment Type

Javascript example

Get Entity Attachments

You can only request the full list of attachments as we haven't had a need to filter them.
This will likely change in the future.

Get Entity Attachments

Response
interface IResponse {
    Items: {
        // Attachment ID.
        ID: number;
        // Associated Client File record.
        ClientFile?: ClientFile.IFile;
        // Associated Client File ID.
        "ClientFile.ID": string;
        // Display order among sibling attachments.
        DisplayOrder?: number;
        // Entity this attachment is associated with.
        "Entity.ID": string;
        // Attachment type ID.
        "EntityAttachmentType.ID": Type;
    }[];
}
Javascript example

Update display order

If you have the need to re-order attachments so that certain ones appear first, you can use this request.
This order is tied to the Entity ID and Attachment Type ID.

Update display order

Request body
interface IRequest {
    // Array of Client Files to update display order for.
    // These should be in the desired order.
    "ClientFile.ID": string[];
    // The starting display order for the first Client File when updating.
    // Typically this is 0.
    "DisplayOrder.Start": number;
}

Delete Entity Attachments

Deleting Attachments does not delete the corresponding Client File records, it only unlinks them from the Entity.

Delete Entity Attachments

Request body
interface IRequest {
    // Array of the related Client File IDs we want to unlink from the Entity.
    "ClientFile.ID": string[];
}

Create / update Entity Attachments

You can request an array of Attachments to update or create the links to an Entity.
It is recommended to read the Client and temp files documentation first.

Update Entity Attachments

Request body
interface IRequest {
    "attachments": {
        // Associated Client File ID.
        "ClientFile.ID": string;
        // Display order among sibling attachments.
        DisplayOrder?: number;
        // Entity this attachment is associated with.
        "Entity.ID": string;
        // Attachment type ID.
        "EntityAttachmentType.ID": Type;
    }[];
}