• Get an attachment

    Parameters

    • attachmentId: string

      unique identifier of the attachment

    • attachmentService: AttachmentService

      injected service use to handle the attachment related operations

      • getOneAttachment
      • normalizeAttachment
    • logger: Logger

      injected logger used to handle the logging

    • context: AdapterHandlerContext

      request context [headers, body, params, query].

    Returns Promise<AdapterHandlerResponse>

    200 Status OK

    • data: normalized attachment

    Description

    This handler is used to get an attachment by applying the following steps in sequence:

    1. Get the attachment (attachmentService.getOneAttachment)

    2. Normalize the attachment (attachmentService.normalizeAttachment)

    3. Return the normalized attachment

    Throws

    404 NBError Not Found

    • attachment not exist

    Throws

    500 NBError Internal Server Error

    • error getting attachment

    Example: example data response

    {
    "id": "1",
    "ownerId": "userId",
    "ownerType": "user",
    "name": "image.png",
    "type": "image/png",
    "isPublic": true,
    "url": "https://api.example.com/attachments/objectId",
    }

Generated using TypeDoc