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

    Class Badges

    Index

    Constructors

    Methods

    • Fetches a list of badges.

      • For unauthenticated users, this returns a list of public "onboarding" badges.
      • For authenticated users, this returns their personalized list of badges including progress.

      Returns Promise<Paginated<Badge>>

      A promise that resolves to a paginated list of badge objects.

      If the request fails.

    • Fetches the details of a specific badge by its ID.

      • For unauthenticated users, this returns the public details of the badge.
      • For authenticated users, this returns personalized details including their progress.

      Parameters

      • id: number

        The unique identifier for the badge.

      Returns Promise<Badge>

      A promise that resolves to the badge object.

      If the request fails.

    • Gets all badge IDs that a specific observation contributes to.

      Parameters

      • observationId: number

        The unique identifier for the observation.

      Returns Promise<Paginated<{ id: number }>>

      A promise that resolves to a paginated list of badge IDs.

      If the request is not authenticated.

      If the request fails.

    • Marks all regular badges as "seen" for the current user. This updates the last_seen timestamp for all of the user's regular badges.

      Returns Promise<{ last_seen: string }>

      A promise that resolves to an object with the last_seen timestamp.

      If the request is not authenticated.

      If the request fails.

    • Gets the last_seen timestamp for a specific regular user badge.

      Parameters

      • userBadgeId: number

        The unique identifier for the user badge.

      Returns Promise<{ last_seen: string }>

      A promise that resolves to an object with the last_seen timestamp.

      If the request is not authenticated.

      If the request fails.

    • Marks a specific regular user badge as "seen".

      Parameters

      • userBadgeId: number

        The unique identifier for the user badge.

      Returns Promise<{ last_seen: string }>

      A promise that resolves to an object with the updated last_seen timestamp.

      If the request is not authenticated.

      If the request fails.

    • Gets the last_seen timestamp for a specific user season badge.

      Parameters

      • userSeasonBadgeId: number

        The unique identifier for the user season badge.

      Returns Promise<{ last_seen: string }>

      A promise that resolves to an object with the last_seen timestamp.

      If the request is not authenticated.

      If the request fails.

    • Marks a specific user season badge as "seen".

      Parameters

      • userSeasonBadgeId: number

        The unique identifier for the user season badge.

      Returns Promise<{ last_seen: string }>

      A promise that resolves to an object with the updated last_seen timestamp.

      If the request is not authenticated.

      If the request fails.