APIs
AuthApi
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new AuthApi($config);
Parameters
config Configuration
The API key for your application. You can generate an API key in the Admin Panel for your application. Please note: Don’t expose the API key in unsecure environments like Web Apps.
generateAccessToken
\SCILL\Model\AccessToken|\SCILL\Model\Error generateAccessToken(ForeignUserIdentifier body);
Parameters
body ForeignUserIdentifier
Foreign user identifier.
Returns
In case of a success, this function returns an instance of AccessToken. In case of a failure, this function returns an instance of Error or .
getUserChallengeNotificationTopic
\SCILL\Model\NotificationTopic|\SCILL\Model\Error getUserChallengeNotificationTopic(string challenge_id);
Get a topic to be used with an MQTT client to receive real time updates whenever the challenge changes.
Parameters
challenge_id string
The challenge id you want to get notified
Returns
In case of a success, this function returns an instance of NotificationTopic. In case of a failure, this function returns an instance of Error.
getUserChallengesNotificationTopic
\SCILL\Model\NotificationTopic|\SCILL\Model\Error getUserChallengesNotificationTopic();
Get a topic to be used with an MQTT client to receive real time updates whenever challenges for the user provided by the access token change.
Returns
In case of a success, this function returns an instance of NotificationTopic. In case of a failure, this function returns an instance of Error.
getUserBattlePassNotificationTopic
\SCILL\Model\NotificationTopic|\SCILL\Model\Error getUserBattlePassNotificationTopic(string battle_pass_id);
Get a topic to be used with an MQTT client to receive real time updates whenever a battle pass changes.
Parameters
battle_pass_id string
The battle pass you want to get notified
Returns
In case of a success, this function returns an instance of NotificationTopic. In case of a failure, this function returns an instance of Error.
getLeaderboardNotificationTopic
\SCILL\Model\NotificationTopic|\SCILL\Model\Error getLeaderboardNotificationTopic(string leaderboard_id);
Get a topic to be used with an MQTT client to receive real time updates whenever the specified leaderboard changes.
Parameters
leaderboard_id string
The id of the leaderboard you want to get notified
Returns
In case of a success, this function returns an instance of NotificationTopic. In case of a failure, this function returns an instance of Error.
getUserInfo
\SCILL\Model\UserInfo|\SCILL\Model\Error getUserInfo();
Returns additional info object with usernames and avatar image for a user which is used in the leaderboard system
Returns
In case of a success, this function returns an instance of UserInfo. In case of a failure, this function returns an instance of Error.
setUserInfo
\SCILL\Model\UserInfo|\SCILL\Model\Error setUserInfo(UserInfo body);
Sets user info like username and avatar image which is returned as part of the user rankings in leaderboards.
Parameters
body UserInfo
UserInfo object stored in the SCILL database for the user
Returns
In case of a success, this function returns an instance of UserInfo. In case of a failure, this function returns an instance of Error.
EventsApi
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new EventsApi($config);
Parameters
config Configuration
The API key for your application. You can generate an API key in the Admin Panel for your application. Please note: Don’t expose the API key in unsecure environments like Web Apps.
sendEvent
\SCILL\Model\ActionResponse|\SCILL\Model\UnknownChallengeError sendEvent(EventPayload body);
Post an event to the SCILL backend
Parameters
body EventPayload
Event payload or team event payload
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of or UnknownChallengeError.
getAvailableEvents
\SCILL\Model\EventDescription[] getAvailableEvents();
Get all available events and required and optional properties
Returns
In case of a success, this function returns an instance of EventDescription[]. In case of a failure, this function returns an instance of .
ChallengesApi
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new ChallengesApi($config);
Parameters
config Configuration
You need to provide an access token that you previously generated with the EventsApi. Please check out the documentation about access tokens for more info.
getPersonalChallenges
\SCILL\Model\ChallengeCategory[]|\SCILL\Model\Error getPersonalChallenges(string appId, array include_categories?, array exclude_categories?, string language?);
Get personal challenges organized in categories
Parameters
appId string
The app id
include_categories array
A list of categories that should be included in the response. Only the categories provided will be returned
exclude_categories array
A list of categories that should be excluded from the response. All categories except those listed here will be returned
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ChallengeCategory[]. In case of a failure, this function returns an instance of Error.
getUnresolvedPersonalChallenges
\SCILL\Model\ChallengeCategory[]|\SCILL\Model\Error getUnresolvedPersonalChallenges(string appId, array include_categories?, array exclude_categories?, string language?);
Get personal challenges organized in categories that are not yet finished
Parameters
appId string
The app id
include_categories array
A list of categories that should be included in the response. Only the categories provided will be returned
exclude_categories array
A list of categories that should be excluded from the response. All categories except those listed here will be returned
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ChallengeCategory[]. In case of a failure, this function returns an instance of Error.
getAllPersonalChallenges
\SCILL\Model\ChallengeCategory[]|\SCILL\Model\Error getAllPersonalChallenges(string appId, array include_categories?, array exclude_categories?, string language?);
Get personal challenges organized in categories that are not yet finished
Parameters
appId string
The app id
include_categories array
A list of categories that should be included in the response. Only the categories provided will be returned
exclude_categories array
A list of categories that should be excluded from the response. All categories except those listed here will be returned
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ChallengeCategory[]. In case of a failure, this function returns an instance of Error.
getPersonalChallengeById
\SCILL\Model\Challenge|\SCILL\Model\Error getPersonalChallengeById(string appId, string challengeId, string language?);
Get personal challenges organized in categories
Parameters
appId string
The app id
challengeId string
The challenge id (see challenge_id of Challenge object)
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of Challenge. In case of a failure, this function returns an instance of Error.
getActivePersonalChallenges
\SCILL\Model\ChallengeCategory[]|\SCILL\Model\Error getActivePersonalChallenges(string appId, string language?);
Get active personal challenges organized in categories
Parameters
appId string
The app id
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ChallengeCategory[]. In case of a failure, this function returns an instance of Error.
unlockPersonalChallenge
\SCILL\Model\ActionResponse|\SCILL\Model\Error unlockPersonalChallenge(string appId, string challengeId, string language?);
Unlock a personal challenge by product id and challenge id
Parameters
appId string
The app id
challengeId string
The challenge id (see challenge_id of Challenge object)
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
activatePersonalChallenge
\SCILL\Model\ActionResponse|\SCILL\Model\Error activatePersonalChallenge(string appId, string challengeId, string language?);
Activate a personal challenge by product id and user challenge id
Parameters
appId string
The app id
challengeId string
The challenge id (see challenge_id of Challenge object)
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
cancelPersonalChallenge
\SCILL\Model\ActionResponse|\SCILL\Model\Error cancelPersonalChallenge(string appId, string challengeId, string language?);
Cancel an active personal challenge by product id and user challenge id
Parameters
appId string
The app id
challengeId string
The challenge id (see challenge_id of Challenge object)
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
claimPersonalChallengeReward
\SCILL\Model\ActionResponse|\SCILL\Model\Error claimPersonalChallengeReward(string appId, string challengeId, string language?);
Claim the reward of a finished personal challenge by product id and user challenge id
Parameters
appId string
The app id
challengeId string
The challenge id (see challenge_id of Challenge object)
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
generateWebsocketAccessToken
\SCILL\Model\SocketToken|\SCILL\Model\Error generateWebsocketAccessToken();
Get an access token for the Websockets server notifying of updates in real time
Returns
In case of a success, this function returns an instance of SocketToken. In case of a failure, this function returns an instance of Error.
resetUserAppChallenges
\SCILL\Model\ActionResponse|\SCILL\Model\Error resetUserAppChallenges(string appId, string userId);
Resets all challenges for the given app ID and user ID
Parameters
appId string
The app id
userId string
The user id (
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
BattlePassesApi
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new BattlePassesApi($config);
Parameters
config Configuration
You need to provide an access token that you previously generated with the EventsApi. Please check out the documentation about access tokens for more info.
getBattlePasses
\SCILL\Model\BattlePass[]|\SCILL\Model\Error getBattlePasses(string appId, string language?);
Get battle passes for the product
Parameters
appId string
The app id
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePass[]. In case of a failure, this function returns an instance of Error.
getActiveBattlePasses
\SCILL\Model\BattlePass[]|\SCILL\Model\Error getActiveBattlePasses(string appId, string language?);
Get active battle passes for the app
Parameters
appId string
The app id
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePass[]. In case of a failure, this function returns an instance of Error.
getUnlockedBattlePasses
\SCILL\Model\BattlePass[]|\SCILL\Model\Error getUnlockedBattlePasses(string appId, string language?);
Get unlocked battle passes for the user encoded in the access token
Parameters
appId string
The app id
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePass[]. In case of a failure, this function returns an instance of Error.
getBattlePass
\SCILL\Model\BattlePass|\SCILL\Model\Error getBattlePass(string appId, string battlePassId, string language?);
Get battle pass for the product with id
Parameters
appId string
The app id
battlePassId string
The id of the battle pass. It’s the same as in battle_pass_id you received in earlier requests (i.e. getting all active battle passes for a product).
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePass. In case of a failure, this function returns an instance of Error.
getBattlePassLevels
\SCILL\Model\BattlePassLevel[]|\SCILL\Model\Error getBattlePassLevels(string appId, string battlePassId, string language?);
Get battle pass levels for a battle pass
Parameters
appId string
The app id
battlePassId string
The id of the battle pass. It’s the same as in battle_pass_id you received in earlier requests (i.e. getting all active battle passes for a product).
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePassLevel[]. In case of a failure, this function returns an instance of Error.
getAllBattlePassLevels
\SCILL\Model\BattlePassLevel[]|\SCILL\Model\Error getAllBattlePassLevels(string appId, string language?);
Get all battle pass levels for an app
Parameters
appId string
The app id
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePassLevel[]. In case of a failure, this function returns an instance of Error.
activateBattlePassLevel
\SCILL\Model\ActionResponse|\SCILL\Model\Error activateBattlePassLevel(string appId, string levelId, string language?);
Activate a given battle pass level by id
Parameters
appId string
The app id
levelId string
The id of the battle pass level.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
claimBattlePassLevelReward
\SCILL\Model\ActionResponse|\SCILL\Model\Error claimBattlePassLevelReward(string appId, string levelId, string language?);
Claim the battle pass level id
Parameters
appId string
The app id
levelId string
The id of the battle pass level.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
unlockBattlePass
\SCILL\Model\BattlePassUnlockInfo|\SCILL\Model\Error unlockBattlePass(string appId, string battlePassId, string language?);
Unlock the battle pass for a user
Parameters
appId string
The app id
battlePassId string
The id of the battle pass. It’s the same as in battle_pass_id you received in earlier requests (i.e. getting all active battle passes for a product).
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of BattlePassUnlockInfo. In case of a failure, this function returns an instance of Error.
Leaderboards V2Api
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new Leaderboards V2Api($config);
Parameters
config Configuration
You need to provide an access token that you previously generated with the EventsApi. Please check out the documentation about access tokens for more info.
getLeaderboardV2
\SCILL\Model\LeaderboardV2Results|\SCILL\Model\Error getLeaderboardV2(string leaderboardId, string startDate?, string endDate?, string aggregate?, number currentPage?, number currentPosition?, number pageSize?, string language?);
Provides the selected leaderboard V2 rankings for a specific leaderboard.
Parameters
leaderboardId string
The id of the leaderboard
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
aggregate string
The aggregate function for the calculation of the results - can be BEST (returns a single score - either the lowest if ASC sorting is used, or the highest if DESC is used) or SUM (default value - increments (sums up) the scores).
currentPage int
The page index starting at 1. The number of pageSize elements are returned for each page. Default value is 1
currentPosition int
The starting leaderboard position from which the results should be loaded. The number of results is controlled via the pageSize variable. This parameter overrides the currentPage parameter.
pageSize int
The number of elements per page. Default is 25.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardV2Results. In case of a failure, this function returns an instance of Error.
getLeaderboardsV2
\SCILL\Model\LeaderboardV2Results[]|\SCILL\Model\Error getLeaderboardsV2(string startDate?, string endDate?, string aggregate?, number currentPage?, number currentPosition?, number pageSize?, string language?);
Returns an array of LeaderboardV2Results items defined for the application.
Parameters
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
aggregate string
The aggregate function for the calculation of the results - can be BEST (returns a single score - either the lowest if ASC sorting is used, or the highest if DESC is used) or SUM (default value - increments (sums up) the scores).
currentPage int
The page index starting at 1. The number of pageSize elements are returned for each page. Default value is 1
currentPosition int
The starting leaderboard position from which the results should be loaded. The number of results is controlled via the pageSize variable. This parameter overrides the currentPage parameter.
pageSize int
The number of elements per page. Default is 25.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardV2Results[]. In case of a failure, this function returns an instance of Error.
getLeaderboardV2Rankings
\SCILL\Model\LeaderboardV2MemberRanking[]|\SCILL\Model\Error getLeaderboardV2Rankings(string memberType, string memberId, string startDate?, string endDate?, string aggregate?, string language?);
Returns an array of LeaderboardV2MemberRanking items defined for all leaderboards in the application specified for the user. If the member is not in the leaderboard, the rank will be -1 in the LeaderboardRanking object.
Parameters
memberType string
The member type, can be user or team (right now) and sets which leaderboards should be selected.
memberId string
Either the user_id or team_id you used when sending the events. The memberType flag identifies which one is used.
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
aggregate string
The aggregate function for the calculation of the results - can be BEST (returns a single score - either the lowest if ASC sorting is used, or the highest if DESC is used) or SUM (default value - increments (sums up) the scores).
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardV2MemberRanking[]. In case of a failure, this function returns an instance of Error.
getLeaderboardV2Ranking
\SCILL\Model\LeaderboardV2MemberRanking|\SCILL\Model\Error getLeaderboardV2Ranking(string memberType, string memberId, string leaderboardId, string startDate?, string endDate?, string aggregate?, string language?);
Returns a LeaderboardV2MemberRanking item for the specified leaderboard. Use this route to get the position of a user of team in a specified leaderboard.
Parameters
memberType string
The member type, can be user or team (right now) and sets which leaderboards should be selected.
memberId string
Either the user_id or team_id you used when sending the events. The memberType flag identifies which one is used.
leaderboardId string
The id of the leaderboard
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
aggregate string
The aggregate function for the calculation of the results - can be BEST (returns a single score - either the lowest if ASC sorting is used, or the highest if DESC is used) or SUM (default value - increments (sums up) the scores).
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardV2MemberRanking. In case of a failure, this function returns an instance of Error.
resetLeaderboardV2Rankings
\SCILL\Model\ActionResponse|\SCILL\Model\Error resetLeaderboardV2Rankings(string appId, string leaderboardId);
Deletes all leaderboard V2 data, i.e. reset the leaderboard V2.
Parameters
appId string
The application ID
leaderboardId string
The leaderboard ID
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.
LeaderboardsApi
Constructor
It’s not recommended to manually initialize APIs. Please use SCILLClient class to initiate API instances.
new LeaderboardsApi($config);
Parameters
config Configuration
You need to provide an access token that you previously generated with the EventsApi. Please check out the documentation about access tokens for more info.
getLeaderboard
\SCILL\Model\Leaderboard|\SCILL\Model\Error getLeaderboard(string leaderboardId, number currentPage?, number pageSize?, string startDate?, string endDate?, string language?);
Provides the current leaderboard rankings for a specific leaderboard.
Parameters
leaderboardId string
The id of the leaderboard
currentPage int
The page index starting at 1. The number of pageSize elements are returned for each page. Default value is 1
pageSize int
The number of elements per page. Default is 25.
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of Leaderboard. In case of a failure, this function returns an instance of Error.
getLeaderboards
\SCILL\Model\Leaderboard[]|\SCILL\Model\Error getLeaderboards(number currentPage?, number pageSize?, string startDate?, string endDate?, string language?);
Returns an array of Leaderboard items defined for the application.
Parameters
currentPage int
The page index starting at 1. The number of pageSize elements are returned for each page. Default value is 1
pageSize int
The number of elements per page. Default is 25.
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of Leaderboard[]. In case of a failure, this function returns an instance of Error.
getLeaderboardRankings
\SCILL\Model\LeaderboardMemberRanking[]|\SCILL\Model\Error getLeaderboardRankings(string memberType, string memberId, string startDate?, string endDate?, string language?);
Returns an array of LeaderboardRanking items defined for all leaderboards in the application specified for the user. If the member is not in the leaderboard, the rank will be -1 in the LeaderboardRanking object.
Parameters
memberType string
The member type, can be user or team (right now) and sets which leaderboards should be selected.
memberId string
Either the user_id or team_id you used when sending the events. The memberType flag identifies which one is used.
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardMemberRanking[]. In case of a failure, this function returns an instance of Error.
getLeaderboardRanking
\SCILL\Model\LeaderboardMemberRanking|\SCILL\Model\Error getLeaderboardRanking(string memberType, string memberId, string leaderboardId, string startDate?, string endDate?, string language?);
Returns a LeaderboardMemberRanking item for the specified leaderboard. Use this route to get the position of a user of team in a specified leaderboard.
Parameters
memberType string
The member type, can be user or team (right now) and sets which leaderboards should be selected.
memberId string
Either the user_id or team_id you used when sending the events. The memberType flag identifies which one is used.
leaderboardId string
The id of the leaderboard
startDate string
The starting date for fetching results.
endDate string
The ending date for fetching results.
language string
Set the language. Content can be translated in the Admin Panel. Values can be international language codes like de, en, fr, it, …
Returns
In case of a success, this function returns an instance of LeaderboardMemberRanking. In case of a failure, this function returns an instance of Error.
resetLeaderboardRankings
\SCILL\Model\ActionResponse|\SCILL\Model\Error resetLeaderboardRankings(string memberType, string appId, string memberId);
Delete all leaderboard data, i.e. reset the leaderboard for the specified member.
Parameters
memberType string
The member type, can be user or team (right now) and sets which leaderboards should be selected.
appId string
The application ID
memberId string
Either the user_id or team_id you used when sending the events. The memberType flag identifies which one is used.
Returns
In case of a success, this function returns an instance of ActionResponse. In case of a failure, this function returns an instance of Error.