observation-js Documentation - v1.16.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.

    • Creates (or updates) multiple observations in one request via the one-way-sync endpoint (POST /observations/create/).

      The endpoint replies with one result per submitted observation, in order: on success the URL of the created/updated observation, otherwise an object describing the field errors. An error for one observation does not prevent the others from being created.

      Media uploads, links and details are not supported by this endpoint; use create for those. Observations are matched/updated by their external_id.

      Parameters

      Returns Promise<SyncObservationResult[]>

      A promise that resolves to a list of per-observation results.

      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.

    • Lists observations filtered by the supplied parameters. This is the general observations list endpoint (GET /observations/). Requires authentication.

      Parameters

      • params: ObservationSearchParams = {}

        Search and filtering parameters.

      Returns Promise<Paginated<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 species.

      Parameters

      • speciesId: number

        The unique identifier of the species.

      • params: ObservationSearchParams = {}

        Optional filtering parameters.

      Returns Promise<Paginated<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<Paginated<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<Paginated<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<Paginated<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

        Center coordinates, time window and search parameters.

      Returns Promise<Paginated<Observation>>

      A promise that resolves to a paginated list of observations.

      If the request fails.

    • Lists observations that have been deleted at or after a given timestamp. Each entry contains the original observation id and the moment of deletion, which is enough to synchronize localized storage. Requires authentication.

      Parameters

      • modifiedSince: string

        ISO8601 date or datetime to list deletions from.

      Returns Promise<Paginated<DeletedObservation>>

      A promise that resolves to a paginated list of deleted observations.

      If the request is not authenticated.

      If the request fails.