observation-js Documentation - v1.14.0
    Preparing search index...

    Class Media

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Uploads a media file (photo or sound) to get a temporary name. This temporary name can then be used when creating or updating an observation.

      Parameters

      • media: Blob

        The media file (as a Blob) to upload.

      • options: { identify?: boolean } = {}

        Optional parameters.

        • Optionalidentify?: boolean

          If true, the system will attempt to identify the species in the media.

      Returns Promise<MediaUploadResponse>

      A promise that resolves to the media upload response, containing the temporary name.

      If the request is not authenticated.

      If the request fails.

    • Fetches similar media items for a given media ID. This endpoint can be used with or without authentication.

      Parameters

      • id: number

        The unique identifier of the media item.

      Returns Promise<Paginated<MediaItem>>

      A promise that resolves to a paginated list of similar media items.

      If the request fails.