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

    Class Observations

    Index

    Constructors

    Methods

    • Retrieves a single observation by its ID.

      Parameters

      • id: number

        The unique identifier of the observation.

      Returns Promise<Observation>

      A promise that resolves to the observation object.

      If the request is not authenticated.

      If the request fails.

    • Deletes an observation by its ID.

      Parameters

      • id: number

        The unique identifier of the observation to delete.

      Returns Promise<void>

      A promise that resolves when the observation is successfully deleted.

      If the request is not authenticated.

      If the request fails.

    • Search/list observations with filtering options. Note: General observation listing may not be available. Use more specific methods like getBySpecies, getByLocation, etc.

      Parameters

      • params: ObservationSearchParams = {}

        Search and filtering parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request fails.

    • Retrieves observations for a specific species.

      Parameters

      • speciesId: number

        The unique identifier of the species.

      • params: ObservationSearchParams = {}

        Optional filtering parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request fails.

    • Retrieves related species observations for a specific species. Requires authentication.

      Parameters

      • speciesId: number

        The unique identifier of the species.

      • params: ObservationSearchParams = {}

        Optional filtering parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request is not authenticated.

      If the request fails.

    • Retrieves observations for a specific user. If no userId is provided, returns observations for the authenticated user. Requires authentication.

      Parameters

      • OptionaluserId: number

        The unique identifier of the user (optional for current user).

      • params: ObservationSearchParams = {}

        Optional filtering parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request is not authenticated.

      If the request fails.

    • Retrieves observations for a specific location.

      Parameters

      • locationId: number

        The unique identifier of the location.

      • params: ObservationSearchParams = {}

        Optional filtering parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request fails.

    • Retrieves observations around a specific geographic point.

      Parameters

      • params: AroundPointParams

        Point coordinates and search parameters.

      Returns Promise<PaginatedResponse<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request fails.

    • Retrieves observations that were deleted after a specific timestamp. Requires authentication.

      Parameters

      • modifiedAfter: string

        ISO timestamp to get deletions after this point.

      Returns Promise<{ results: number[] }>

      A promise that resolves to a list of deleted observation IDs.

      If the request is not authenticated.

      If the request fails.