Sign in

APIs

SCILLClient

Use this class to initiate APIs.

Constructor

Initiate an instance of the SCILLClient class with the api key created in the Admin Panel.

public function __construct($apiKey, $development = false);
Parameters

apiKey string

This is the app id of your application. Use the Admin Panel to reveal the app id for your application.

development boolean

Set to true if you want to work with our development system. You should only do that upon request of our tech support team. Otherwise just leave out or set to false.

getAuthClient

Initiate an instance of the AuthApi with the API key of your application. Use this API to generate an access token.

Please note: This class should not be used in client side code (i.e. in the Browser or Web Apps) as the API key might be easily captured using Web console, giving the attacker a lot of power. Use this class in a NodeJS backend, serving your client.

public function getAuthClient();
Returns

An instance of the AuthApi class. Setup for production use.

getEventsClient

Initiate an instance of the EventsApi with the API key of your application. It’s used to send events required for challenges and battle passes.

public function getEventsClient();
Returns

An instance of the EventsApi class. Setup for production use.

getChallengesClient

public function getChallengesClient();
Returns

An instance of the ChallengesApi class. Setup for production use.

sendEvent

public function sendEvent($eventName, $userId, $sessionId, $metaData = array(), $eventType ='single');
Parameters

eventName string

The name of the event type. Please see [Event Types](/events.html for more info.

userId string

The user id of the user that should be attached to this event. Please see [User Ids](/api/authentication.html#user-ids for more info.

sessionId string

If you want to group events use the session id to group events.

metaData EventMetaData

A hash array with additional parameters that should be sent along this event. This is useful to store the weapon or the maps name. There are many properties. Please see [Event Types](/events.html for a list of properties available for the event type you want to send.

eventType string

Leave this to single. Can also be group which allows you to send multiple events in a group (requires sessionId to be set).

Returns

An instance of the \SCILL\Model\ActionResponse class.

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 generateAccessToken($body);
Parameters

body ForeignUserIdentifier

Foreign user identifier.

getUserChallengeNotificationTopic

\SCILL\Model\NotificationTopic getUserChallengeNotificationTopic($challenge_id);

Get a topic to be used with an MQTT client to receive real time updates whenever a challenge changes.

Parameters

challenge_id string OPTIONAL

The challenge id you want to get notified

getUseBattlePassNotificationTopic

\SCILL\Model\NotificationTopic getUseBattlePassNotificationTopic($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

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 sendEvent($body);

Post an event to the SCILL backend

Parameters

body EventPayload

Event payload

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[] getPersonalChallenges($appId);

Get personal challenges organized in categories

Parameters

appId string

The app id

getPersonalChallengeById

\SCILL\Model\Challenge getPersonalChallengeById($appId, $challengeId);

Get personal challenges organized in categories

Parameters

appId string

The app id

challengeId string

The challenge id (see challenge_id of Challenge object)

getActivePersonalChallenges

\SCILL\Model\ChallengeCategory[] getActivePersonalChallenges($appId);

Get active personal challenges organized in categories

Parameters

appId string

The app id

unlockPersonalChallenge

\SCILL\Model\ActionResponse unlockPersonalChallenge($appId, $challengeId);

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)

activatePersonalChallenge

\SCILL\Model\ActionResponse activatePersonalChallenge($appId, $challengeId);

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)

cancelPersonalChallenge

\SCILL\Model\ActionResponse cancelPersonalChallenge($appId, $challengeId);

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)

claimPersonalChallengeReward

\SCILL\Model\ActionResponse claimPersonalChallengeReward($appId, $challengeId);

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)

generateWebsocketAccessToken

\SCILL\Model\SocketToken generateWebsocketAccessToken();

Get an access token for the Websockets server notifying of updates in real time

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[] getBattlePasses($appId);

Get battle passes for the product

Parameters

appId string

The app id

getActiveBattlePasses

\SCILL\Model\BattlePass[] getActiveBattlePasses($appId);

Get active battle passes for the app

Parameters

appId string

The app id

getUnlockedBattlePasses

\SCILL\Model\BattlePass[] getUnlockedBattlePasses($appId);

Get unlocked battle passes for the user encoded in the access token

Parameters

appId string

The app id

getBattlePass

\SCILL\Model\BattlePass getBattlePass($appId, $battlePassId);

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).

getBattlePassLevels

\SCILL\Model\BattlePassLevel[] getBattlePassLevels($appId, $battlePassId);

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).

getAllBattlePassLevels

\SCILL\Model\BattlePassLevel[] getAllBattlePassLevels($appId);

Get all battle pass levels for an app

Parameters

appId string

The app id

activateBattlePassLevel

\SCILL\Model\ActionResponse activateBattlePassLevel($appId, $levelId);

Activate a given battle pass level by id

Parameters

appId string

The app id

levelId string

The id of the battle pass level.

claimBattlePassLevelReward

\SCILL\Model\ActionResponse claimBattlePassLevelReward($appId, $levelId);

Claim the battle pass level id

Parameters

appId string

The app id

levelId string

The id of the battle pass level.

unlockBattlePass

\SCILL\Model\BattlePassUnlockInfo unlockBattlePass($appId, $battlePassId);

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).