Documentation

LeaderboardsApi

Import

Import

  • const { LeaderboardsApi } = require("@unity-services/leaderboards-1.1");

Constructors

Constructor

Methods

Add Leaderboard Player Score

  • addLeaderboardPlayerScore(projectId: string, leaderboardId: string, playerId: string, leaderboardScore?: LeaderboardScore, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>
  • Add score for the specified player to the specified leaderboard.

    summary

    Add Leaderboard Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional leaderboardScore: LeaderboardScore
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<void>>

Get Leaderboard Player Score

  • getLeaderboardPlayerScore(projectId: string, leaderboardId: string, playerId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardEntry>>
  • Get score and rank for the specified player in the specified leaderboard.

    summary

    Get Leaderboard Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardEntry>>

Get Leaderboard Scores

  • getLeaderboardScores(projectId: string, leaderboardId: string, offset?: number, limit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardScoresPage>>
  • Get list of scores and ranks for the specified leaderboard, with specified pagination.

    summary

    Get Leaderboard Scores

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardScoresPage>>

Get Leaderboard Scores By Player Ids

  • Get list of scores and ranks for the specified leaderboard, with specified playerIds.

    summary

    Get Scores By PlayerIds

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional leaderboardPlayerIds: LeaderboardPlayerIds
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardScoresWithNotFoundPlayerIds>>

Get Leaderboard Scores By Player Ids Archive Version

  • Get list of scores and ranks for an archived leaderboard, with specified playerIds.

    summary

    Get Scores By PlayerIds for Archived Leaderboard

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • Optional leaderboardPlayerIds: LeaderboardPlayerIds
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersionScoresByPlayerIds>>

Get Leaderboard Scores By Tier

  • getLeaderboardScoresByTier(projectId: string, leaderboardId: string, tierId: string, offset?: number, limit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardTierScoresPage>>
  • Get list of scores and ranks for the specified leaderboard, within the specified tier, with specified pagination.

    summary

    Get Leaderboard Scores By Tier

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • tierId: string

      ID of the leaderboard tier.

    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardTierScoresPage>>

Get Leaderboard Scores Player Range

  • getLeaderboardScoresPlayerRange(projectId: string, leaderboardId: string, playerId: string, rangeLimit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardScores>>
  • Get the list of neighbouring players for the specified player Id.

    summary

    Get Player Range

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • playerId: string

      ID of the player

    • Optional rangeLimit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardScores>>

Get Leaderboard Version Player Score

  • getLeaderboardVersionPlayerScore(projectId: string, leaderboardId: string, versionId: string, playerId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardVersionEntry>>
  • Get score and rank for the specified player in the specified archived leaderboard version.

    summary

    Get Archived Leaderboard Version Player Score

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • playerId: string

      ID of the player

    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersionEntry>>

Get Leaderboard Version Scores

  • getLeaderboardVersionScores(projectId: string, leaderboardId: string, versionId: string, offset?: number, limit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardVersionScoresPage>>
  • Get list of scores and ranks for the specified archived leaderboard version, with specified pagination.

    summary

    Get Archived Leaderboard Version Scores

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersionScoresPage>>

Get Leaderboard Version Scores By Tier

  • getLeaderboardVersionScoresByTier(projectId: string, leaderboardId: string, versionId: string, tierId: string, offset?: number, limit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardVersionTierScoresPage>>
  • Get list of scores and ranks for the specified archived leaderboard version, within the specified tier, with specified pagination.

    summary

    Get Archived Leaderboard Version Scores By Tier

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • tierId: string

      ID of the leaderboard tier.

    • Optional offset: number
    • Optional limit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersionTierScoresPage>>

Get Leaderboard Version Scores Player Range

  • getLeaderboardVersionScoresPlayerRange(projectId: string, leaderboardId: string, versionId: string, playerId: string, rangeLimit?: number, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardVersionRange>>
  • Get the list of neighbouring players for the specified player Id for an archived Leaderboard.

    summary

    Get Player Range for Archived Leaderboard

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • versionId: string

      ID of the leaderboard version

    • playerId: string

      ID of the player

    • Optional rangeLimit: number
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersionRange>>

Get Leaderboard Versions

  • getLeaderboardVersions(projectId: string, leaderboardId: string, options?: AxiosRequestConfig): Promise<AxiosResponse<LeaderboardVersions>>
  • Get list of archived leaderboard versions for the specified leaderboard, with specified pagination.

    summary

    Get Archived Leaderboard Versions

    throws

    {RequiredError}

    memberof

    LeaderboardsApi

    Parameters

    • projectId: string

      The project&#39;s Project ID

    • leaderboardId: string

      ID of the leaderboard

    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<LeaderboardVersions>>