API reference
API reference
Select your platform
No SDKs available
No versions available

Challenges Class

The Challenges API enhances social interactions in your app, which use GroupPresence.SetDestination() to create shareable links for score-based competition. Players can repeatedly challenge others, get to know them, and compete asynchronously. Challenges can be ranked by highest/lowest scores within a time period. Leaderboard-integrated apps get Challenges for free, accessible through the Scoreboards UI. Players can create and invite others to Challenges via the Challenges app.

Static Methods

Create ( leaderboardName , challengeOptions )
DeprecatedUse server-to-server API call instead.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.Create(string leaderboardName, ChallengeOptions challengeOptions)
Parameters
leaderboardName: string  A string represents the name of the leaderboard.
challengeOptions: ChallengeOptions  This indicates the options of the challenge and it can be retrieved by ChallengeOptions().
DeclineInvite ( challengeID )
If the current user has the necessary permissions, they can decline a challenge by providing the challenge ID, which can be obtained using Challenge::ID.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.DeclineInvite(UInt64 challengeID)
Parameters
challengeID: UInt64  The ID of challenge that the user is going to decline. It can be retrieved by Challenge::ID.
Delete ( challengeID )
DeprecatedUse server-to-server API call instead.
Signature
static Request Oculus.Platform.Challenges.Delete(UInt64 challengeID)
Parameters
challengeID: UInt64  The uuid of the challenge.
Returns
Request
Get ( challengeID )
Gets detailed information for a single challenge by providing the challenge ID, which can be retrieved by calling Challenge::ID.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.Get(UInt64 challengeID)
Parameters
challengeID: UInt64  The id of the challenge whose entries to return, which can be retrieved by calling Challenge::ID.
GetEntries ( challengeID , limit , filter , startAt )
Retrieves a list of entries for a specific challenge, with options to filter and limit the results. By providing the challengeID, you can specify which challenge's entries you want to retrieve. The limit parameter allows you to control the number of entries returned. The filter parameter enables you to refine the results to only include entries from users who are bidirectional followers. The startAt parameter allows you to define whether to center the query on the user or start at the top of the challenge.
Signature
static Request<Models.ChallengeEntryList> Oculus.Platform.Challenges.GetEntries(UInt64 challengeID, int limit, LeaderboardFilterType filter, LeaderboardStartAt startAt)
Parameters
challengeID: UInt64  The id of the challenge whose entries to return, which can be retrieved by calling Challenge::ID.
limit: int  Sets a limit on the maximum number of challenges to be fetched, which can be useful for pagination or performance reasons.
filter: LeaderboardFilterType  By using the LeaderboardFilterType, you can refine the results to only include entries from users who are bidirectional followers.
startAt: LeaderboardStartAt  Defines whether to center the query on the user or start at the top of the challenge. If this is LeaderboardStartAt.CenteredOnViewer or LeaderboardStartAt.CenteredOnViewerOrTop, then the current user's ID will be automatically added to the query.
GetEntriesAfterRank ( challengeID , limit , afterRank )
Returns a list of entries for a specific challenge, starting from a specified rank. By providing the challengeID and rank, you can specify which challenge's entries you want to retrieve and where to start the query. The limit parameter allows you to control the number of entries returned.
Signature
static Request<Models.ChallengeEntryList> Oculus.Platform.Challenges.GetEntriesAfterRank(UInt64 challengeID, int limit, ulong afterRank)
Parameters
challengeID: UInt64  The id of the challenge whose entries to return, which can be retrieved by calling Challenge::ID.
limit: int  Sets a limit on the maximum number of challenges to be fetched, which can be useful for pagination or performance reasons.
afterRank: ulong  The position after which to start. For example, 10 returns challenge results starting with the 11th user.
GetEntriesByIds ( challengeID , limit , startAt , userIDs )
Retrieves a list of challenge entries for a specific set of user IDs, with options to filter and limit the results. This method is useful for retrieving a list of challenge entries for a specific set of users, allowing you to display their progress and rankings within the challenge.
Signature
static Request<Models.ChallengeEntryList> Oculus.Platform.Challenges.GetEntriesByIds(UInt64 challengeID, int limit, LeaderboardStartAt startAt, UInt64[] userIDs)
Parameters
challengeID: UInt64  The id of the challenge whose entries to return, which can be retrieved by calling Challenge::ID.
limit: int  Sets a limit on the maximum number of challenges to be fetched, which can be useful for pagination or performance reasons.
startAt: LeaderboardStartAt  Defines whether to center the query on the user or start at the top of the challenge. If this is LeaderboardStartAt.CenteredOnViewer or LeaderboardStartAt.CenteredOnViewerOrTop, then the current user's ID will be automatically added to the query.
userIDs: UInt64 []  Defines a list of user ids to get entries for.
GetList ( challengeOptions , limit )
Returns a list of challenges that match the specified options. The ChallengeOptions() parameter allows you to specify the criteria for the challenges you want to retrieve. The limit parameter allows you to control the number of challenges returned.
Signature
static Request<Models.ChallengeList> Oculus.Platform.Challenges.GetList(ChallengeOptions challengeOptions, int limit)
Parameters
challengeOptions: ChallengeOptions  This indicates the options of the challenge and it can be retrieved by ChallengeOptions().
limit: int  Sets a limit on the maximum number of challenges to be fetched, which can be useful for pagination or performance reasons.
GetNextChallenges ( list )
Retrieves the next page of challenges. If there is no next page, this field will be empty.
Signature
static Request<Models.ChallengeList> Oculus.Platform.Challenges.GetNextChallenges(Models.ChallengeList list)
Parameters
GetNextEntries ( list )
Retrieves the next page of challenge entries. If there is no next page, this field will be empty.
Signature
static Request<Models.ChallengeEntryList> Oculus.Platform.Challenges.GetNextEntries(Models.ChallengeEntryList list)
GetPreviousChallenges ( list )
Retrieves the previous page of challenges. If there is no previous page, this field will be empty.
Signature
static Request<Models.ChallengeList> Oculus.Platform.Challenges.GetPreviousChallenges(Models.ChallengeList list)
Parameters
GetPreviousEntries ( list )
Retrieves the previous page of challenge entries. If there is no previous page, this field will be empty.
Signature
static Request<Models.ChallengeEntryList> Oculus.Platform.Challenges.GetPreviousEntries(Models.ChallengeEntryList list)
Join ( challengeID )
If the current user has the necessary permissions to join, participate in a challenge by providing the challenge ID, which can be retrieved using Challenge::ID.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.Join(UInt64 challengeID)
Parameters
challengeID: UInt64  The ID of challenge that the user is going to join. It can be retrieved by Challenge::ID.
Leave ( challengeID )
If the current user has the necessary permissions, they can leave a challenge by providing the challenge ID, which can be obtained using Challenge::ID.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.Leave(UInt64 challengeID)
Parameters
challengeID: UInt64  The ID of challenge that the user is going to leave. It can be retrieved by Challenge::ID.
UpdateInfo ( challengeID , challengeOptions )
DeprecatedUse server-to-server API call instead.
Signature
static Request<Models.Challenge> Oculus.Platform.Challenges.UpdateInfo(UInt64 challengeID, ChallengeOptions challengeOptions)
Parameters
challengeID: UInt64  The uuid of the challenge.
challengeOptions: ChallengeOptions  This indicates the options of the challenge and it can be retrieved by ChallengeOptions().