Maximo API Client - v0.9.21
    Preparing search index...

    Class AttachmentService

    Service for managing attachments (DocLinks) for a specific Maximo resource

    Index

    Methods

    • Lists all attachments for the resource

      Parameters

      • OptionalinlineDoc: boolean

        If true, includes inline document content in the response

      Returns Promise<DocLink[]>

      A promise resolving to an array of DocLink objects

    • Downloads the content of an attachment

      Parameters

      • attachmentId: string

        The ID of the attachment (from DocLink href)

      Returns Promise<ArrayBuffer>

      A promise resolving to the attachment data (ArrayBuffer)

    • Fetches metadata for a specific attachment (document description, mimetype, etc.) Uses the /doclinks/meta/{id} endpoint per IBM Maximo REST API docs

      Parameters

      • attachmentId: string

        The ID of the attachment (from DocLink href)

      Returns Promise<DocLink>

      A promise resolving to the attachment metadata

    • Deletes an attachment using POST with x-method-override: DELETE Per IBM Maximo REST API docs, attachment deletion requires POST with method override

      Parameters

      • attachmentId: string

        The ID of the attachment to delete

      Returns Promise<void>

    • Uploads a file as an attachment via binary POST to the doclinks endpoint

      Supports two modes:

      1. Direct binary: pass raw Buffer/ArrayBuffer/string data
      2. Base64: pass base64Data and set options.customEncoding to 'base64'

      Parameters

      • fileName: string

        The name of the file

      • data: string | ArrayBuffer | Buffer<ArrayBufferLike>

        The file data (Buffer, ArrayBuffer, or string). If customEncoding='base64', this should be the base64 string.

      • options: AttachmentUploadOptions = {}

        Additional options like description, doctype, content-location, and custom headers

      • Optionalproperties: string | string[]

        Optional properties to return in the response (string or string array)

      Returns Promise<DocLink>

    • Creates an attachment from Base64 encoded data using the custom-encoding header.

      Per IBM Maximo REST API docs, the doclinks endpoint accepts base64-encoded content when the 'custom-encoding: base64' header is set. The base64 string is sent as the body.

      Parameters

      • fileName: string

        The name of the file

      • base64Data: string

        The Base64 encoded file content

      • options: AttachmentUploadOptions = {}

        Additional options like description and doctype

      • Optionalproperties: string | string[]

        Optional properties to return in the response (string or string array)

      Returns Promise<DocLink>

    Constructors

    • Creates a new AttachmentService

      Parameters

      • httpClient: HttpClient

        The HTTP client for making requests

      • objectStructure: string

        The Maximo object structure name (e.g., 'mxapiasset')

      • resourceId: string

        The unique ID of the resource (e.g., '123')

      • apiHome: string

        The API home path (e.g., '/maximo/oslc/os')

      • Optionallogger: ILogger

        Optional logger

      Returns AttachmentService