Player Accounts

The ChilliConnect Player Accounts module. Provides the means to create new players, log in to existing accounts and modify account data.

Create Player

Creates a new, anonymous ChilliConnect player account for a specific game. UserName, DisplayName, Email and Password details can be provided but are not required. Will return a ChilliConnectID and ChilliConnectSecret that uniquely identifies the newly created player. These details can be used to login to the players account via the LogInUsingChilliConnect method.

/player/create

Header

Field Type Description
Game-Token

String

The Game within which to create the new player.

Parameter

Field Type Description
UserName optional

String

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

String

A non-unique DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

String

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

String

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Country optional

String

Country of the player. Must be two letter country code ISO 3166-1 alpha-2. E.g. GB. If not provided, will be automatically populated.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

ChilliConnectSecret

String

The ChilliConnectSecret of the account.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1013

Trial Expired. Trial Period Expired

Error 409

Code Description
2006

UserName Taken. The supplied UserName has already taken by another player within this game.

2007

Email Taken. The supplied Email address has already taken by another player within this game.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "ChilliConnectID"   	: "284LD4sAB5Ygo2RSl8h4vVW48qAbA8Cr",
 "ChilliConnectSecret" 	: "1cIVAEwPRP1czuPkqUEIQmXxwDfIVkGI"
}

Create Player

Creates a new, anonymous ChilliConnect player account for a specific game. UserName, DisplayName, Email and Password details can be provided but are not required. Will return a ChilliConnectID and ChilliConnectSecret that uniquely identifies the newly created player. These details can be used to login to the players account via the LogInUsingChilliConnect method.

Request

CCCreatePlayerRequest
Property Type Description
UserName optional

NSString

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

NSString

A non-unique DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

NSString

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

NSString

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Country optional

NSString

Country of the player. Must be two letter country code ISO 3166-1 alpha-2. E.g. GB. If not provided, will be automatically populated.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CCCreatePlayerResponse
Property Type Description
ChilliConnectID

NSString

The ChilliConnectID of the account.

ChilliConnectSecret

NSString

The ChilliConnectSecret of the account.

Errors

CCCreatePlayerError
Name Description
EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

Examples

CCPlayerAccounts *playerAccounts = chilliConnect.playerAccounts;

CCCreatePlayerResponseCallback successCallback = ^(CCCreatePlayerRequest *request, CCCreatePlayerResponse *response) {
    self.chilliConnectId = response.chilliConnectId;
    self.chilliConnectSecret = response.chilliConnectSecret;
    NSLog(@"Player created with ChilliConnectId: %@", self.chilliConnectId);
};

CCCreatePlayerErrorCallback errorCallback = ^(CCCreatePlayerRequest *request, CCCreatePlayerError *error) {
    NSLog(@"An error occurred while creating a new player: %@", error.errorDescription);
};

CCCreatePlayerRequestDesc *requestDesc = [CCCreatePlayerRequestDesc createPlayerRequestDesc];
requestDesc.displayName = @"TestPlayer";

[playerAccounts createPlayerWithDesc:requestDesc successCallback:successCallback errorCallback:errorCallback];

Create Player

Creates a new, anonymous ChilliConnect player account for a specific game. UserName, DisplayName, Email and Password details can be provided but are not required. Will return a ChilliConnectID and ChilliConnectSecret that uniquely identifies the newly created player. These details can be used to login to the players account via the LogInUsingChilliConnect method.

Request

CreatePlayerRequest
Property Type Description
UserName optional

string

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

string

A non-unique DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

string

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

string

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Country optional

string

Country of the player. Must be two letter country code ISO 3166-1 alpha-2. E.g. GB. If not provided, will be automatically populated.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CreatePlayerResponse
Property Type Description
ChilliConnectID

string

The ChilliConnectID of the account.

ChilliConnectSecret

string

The ChilliConnectSecret of the account.

Errors

CreatePlayerError
Name Description
EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<CreatePlayerRequest, CreatePlayerResponse> successCallback = (CreatePlayerRequest request, CreatePlayerResponse response) =>
{
    ChilliConnectId = response.ChilliConnectId;
    ChilliConnectSecret = response.ChilliConnectSecret;
    
    UnityEngine.Debug.Log("Player created with ChilliConnectId: " + ChilliConnectId);
};

Action<CreatePlayerRequest, CreatePlayerError> errorCallback = (CreatePlayerRequest request, CreatePlayerError error) =>
{
    UnityEngine.Debug.Log("An error occurred while creating a new player: " + error.ErrorDescription);
};

var requestDesc = new CreatePlayerRequestDesc();
requestDesc.DisplayName = "TestPlayer";

playerAccounts.CreatePlayer(requestDesc, successCallback, errorCallback);

Create Player

Creates a new, anonymous ChilliConnect player account for a specific game. UserName, DisplayName, Email and Password details can be provided but are not required. Will return a ChilliConnectID and ChilliConnectSecret that uniquely identifies the newly created player. These details can be used to login to the players account via the LogInUsingChilliConnect method.

Request

ChilliConnect.PlayerAccounts.createPlayer( UserName DisplayName Email Password Country DeviceModel DeviceType Platform )
Parameter Type Description
UserName optional

String

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

String

A non-unique DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

String

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

String

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Country optional

String

Country of the player. Must be two letter country code ISO 3166-1 alpha-2. E.g. GB. If not provided, will be automatically populated.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

Attribute Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

ChilliConnectSecret

String

The ChilliConnectSecret of the account.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

1013 TrialExpired

Trial Expired. Trial Period Expired

2006 UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

2007 EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

Log In Using Chilli Connect

Login to the system using a ChilliConnectID and a ChilliConnectSecret. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests.

/player/login/chilli

Header

Field Type Description
Game-Token

String

The Game to log in to.

Parameter

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

ChilliConnectSecret

String

The player's ChilliConnectSecret.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ConnectAccessToken

String

A time limited ConnectAccessToken that should be used to authenticate the player on subsequent requests.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1005

Invalid Credentials. The supplied credentials were not recognised.

1013

Trial Expired. Trial Period Expired

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10001

Limit Reached. The DAU limit for today has been reached.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "ConnectAccessToken"  : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjEzODY4OTkxMzEsImlzcyI6ImppcmE6MTU0ODk1OTUiLCJxc2giOiI4MDYzZmY0Y2ExZTQxZGY3YmM5MGM4YWI2ZDBmNjIwN2Q0OTFjZjZkYWQ3YzY2ZWE3OTdiNDYxNGI3MTkyMmU5IiwiaWF0IjoxMzg2ODk4OTUxfQ.uKqU9dTB6gKwG6jQCuXYAiMNdfNRw98Hw_IWuA5MaMo"
}

Log In Using Chilli Connect

Login to the system using a ChilliConnectID and a ChilliConnectSecret. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests.

Request

CCLogInUsingChilliConnectRequest
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

ChilliConnectSecret

NSString

The player's ChilliConnectSecret.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Errors

CCLogInUsingChilliConnectError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

CCPlayerAccounts *playerAccounts = chilliConnect.playerAccounts;

CCLogInUsingChilliConnectResponseCallback successCallback = ^(CCLogInUsingChilliConnectRequest *request) {
    NSLog(@"Successfully logged in!");
};

CCLogInUsingChilliConnectErrorCallback errorCallback = ^(CCLogInUsingChilliConnectRequest *request, CCLogInUsingChilliConnectError *error) {
    NSLog(@"An error occurred while logging in: %@", error.errorDescription);
};

CCLogInUsingChilliConnectRequestDesc *desc = [CCLogInUsingChilliConnectRequestDesc logInUsingChilliConnectRequestDescWithChilliConnectId:self.chilliConnectId chilliConnectSecret:self.chilliConnectSecret];
[playerAccounts logInUsingChilliConnect:desc successCallback:successCallback errorCallback:errorCallback];

Log In Using Chilli Connect

Login to the system using a ChilliConnectID and a ChilliConnectSecret. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests.

Request

LogInUsingChilliConnectRequest
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

ChilliConnectSecret

string

The player's ChilliConnectSecret.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Errors

LogInUsingChilliConnectError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LogInUsingChilliConnectRequest> successCallback = (LogInUsingChilliConnectRequest request) =>
{
    UnityEngine.Debug.Log("Successfully logged in!");
};

Action<LogInUsingChilliConnectRequest, LogInUsingChilliConnectError> errorCallback = (LogInUsingChilliConnectRequest request, LogInUsingChilliConnectError error) =>
{
    UnityEngine.Debug.Log("An error occurred while logging in: " + error.ErrorDescription);
};

var loginDesc = new LogInUsingChilliConnectRequestDesc(ChilliConnectId, ChilliConnectSecret);
playerAccounts.LogInUsingChilliConnect(loginDesc, successCallback, errorCallback);

Log In Using Chilli Connect

Login to the system using a ChilliConnectID and a ChilliConnectSecret. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests.

Available in the HTTP, iOS, Unity APIs.

Log In Using Email

Login to the sytem using an Email and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

/player/login/email

Header

Field Type Description
Game-Token

String

The Game to log in to.

Parameter

Field Type Description
Email

String

The player's Email.

Password

String

The player's Password.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

ChilliConnectSecret

String

The player's ChilliConnectSecret.

ConnectAccessToken

String

A time limited ConnectAccessToken that should be used to authenticate the player on subsequent requests.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1005

Invalid Credentials. The supplied credentials were not recognised.

1013

Trial Expired. Trial Period Expired

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10001

Limit Reached. The DAU limit for today has been reached.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "ConnectAccessToken" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjEzODY4OTkxMzEsImlzcyI6ImppcmE6MTU0ODk1OTUiLCJxc2giOiI4MDYzZmY0Y2ExZTQxZGY3YmM5MGM4YWI2ZDBmNjIwN2Q0OTFjZjZkYWQ3YzY2ZWE3OTdiNDYxNGI3MTkyMmU5IiwiaWF0IjoxMzg2ODk4OTUxfQ.uKqU9dTB6gKwG6jQCuXYAiMNdfNRw98Hw_IWuA5MaMo"
 "ChilliConnectID" : "284LD4sAB5Ygo2RSl8h4vVW48qAbA8Cr",
 "ChilliConnectSecret" : "1cIVAEwPRP1czuPkqUEIQmXxwDfIVkGI"
}

Log In Using Email

Login to the sytem using an Email and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

CCLogInUsingEmailRequest
Property Type Description
Email

NSString

The player's Email.

Password

NSString

The player's Password.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CCLogInUsingEmailResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

ChilliConnectSecret

NSString

The player's ChilliConnectSecret.

Errors

CCLogInUsingEmailError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

CCPlayerAccounts *playerAccounts = CCPlayerAccounts.playerAccounts;

CCLogInUsingEmailResponseCallback successCallback = ^(CCLogInUsingEmailRequest *request, CCLogInUsingEmailResponse *response) {
    NSLog(@"Successfully logged in!");
};

CCLogInUsingEmailErrorCallback errorCallback = ^(CCLogInUsingEmailRequest *request, CCLogInUsingEmailError *error) {
    NSLog(@"An error occurred while logging in: %@", error.errorDescription);
};

CCLogInUsingEmailRequestDesc *desc = [CCLogInUsingEmailRequestDesc logInUsingEmailRequestDescWithEmail:@"email@example.com" password:@"Password"];
[playerAccounts logInUsingEmail:desc successCallback:successCallback errorCallback:errorCallback];

Log In Using Email

Login to the sytem using an Email and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

LogInUsingEmailRequest
Property Type Description
Email

string

The player's Email.

Password

string

The player's Password.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

LogInUsingEmailResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

ChilliConnectSecret

string

The player's ChilliConnectSecret.

Errors

LogInUsingEmailError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LogInUsingEmailRequest, LogInUsingEmailResponse> successCallback = (LogInUsingEmailRequest request, LogInUsingEmailResponse response) =>
{
    UnityEngine.Debug.Log("Successfully logged in!");
};

Action<LogInUsingEmailRequest, LogInUsingEmailError> errorCallback = (LogInUsingEmailRequest request, LogInUsingEmailError error) =>
{
    UnityEngine.Debug.Log("An error occurred while logging in: " + error.ErrorDescription);
};

var loginDesc = new LogInUsingEmailRequestDesc("email@example.com", "Password");
playerAccounts.LogInUsingEmail(loginDesc, successCallback, errorCallback);

Log In Using Email

Login to the sytem using an Email and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Available in the HTTP, iOS, Unity APIs.

Log In Using Facebook

Login to the system using a FacebookAccessToken. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

/player/login/facebook

Header

Field Type Description
Game-Token

String

The Game to log in to.

Parameter

Field Type Description
FacebookAccessToken

String

Access Token provided from the Facebook API.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

ChilliConnectSecret

String

The player's ChilliConnectSecret.

ConnectAccessToken

String

A time limited ConnectAccessToken that should be used to authenticate the player on subsequent requests.

FacebookID

String

The player's Facebook account ID.

FacebookName

String

The player's Facebook account name.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1006

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

1013

Trial Expired. Trial Period Expired

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

2002

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

Error 429

Code Description
10001

Limit Reached. The DAU limit for today has been reached.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "ConnectAccessToken" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjEzODY4OTkxMzEsImlzcyI6ImppcmE6MTU0ODk1OTUiLCJxc2giOiI4MDYzZmY0Y2ExZTQxZGY3YmM5MGM4YWI2ZDBmNjIwN2Q0OTFjZjZkYWQ3YzY2ZWE3OTdiNDYxNGI3MTkyMmU5IiwiaWF0IjoxMzg2ODk4OTUxfQ.uKqU9dTB6gKwG6jQCuXYAiMNdfNRw98Hw_IWuA5MaMo"
 "ChilliConnectID" : "284LD4sAB5Ygo2RSl8h4vVW48qAbA8Cr",
 "ChilliConnectSecret" : "1cIVAEwPRP1czuPkqUEIQmXxwDfIVkGI",
 "FacebookID" : "21231232132",
 "FacebookName" : "Mike Herron"
}

Log In Using Facebook

Login to the system using a FacebookAccessToken. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

CCLogInUsingFacebookRequest
Property Type Description
FacebookAccessToken

NSString

Access Token provided from the Facebook API.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CCLogInUsingFacebookResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

ChilliConnectSecret

NSString

The player's ChilliConnectSecret.

FacebookID

NSString

The player's Facebook account ID.

FacebookName

NSString

The player's Facebook account name.

Errors

CCLogInUsingFacebookError
Name Description
FacebookAccessTokenInvalid

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

LoginNotFound

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

CCPlayerAccounts *playerAccounts = chilliConnect.playerAccounts;

CCLogInUsingFacebookResponseCallback successCallback = ^(CCLogInUsingFacebookRequest *request, CCLogInUsingFacebookResponse *response) {
    NSLog(@"Successfully logged in!");
};

CCLogInUsingFacebookErrorCallback errorCallback = ^(CCLogInUsingFacebookRequest *request, CCLogInUsingFacebookError *error) {
    NSLog(@"An error occurred while logging in: %@", error.errorDescription);
};

CCLogInUsingFacebookRequestDesc *desc = [CCLogInUsingFacebookRequestDesc logInUsingFacebookRequestDescWithFacebookAccessToken:facebookAccessToken];
[playerAccounts logInUsingFacebook:desc successCallback:successCallback errorCallback:errorCallback];

Log In Using Facebook

Login to the system using a FacebookAccessToken. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

LogInUsingFacebookRequest
Property Type Description
FacebookAccessToken

string

Access Token provided from the Facebook API.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

LogInUsingFacebookResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

ChilliConnectSecret

string

The player's ChilliConnectSecret.

FacebookID

string

The player's Facebook account ID.

FacebookName

string

The player's Facebook account name.

Errors

LogInUsingFacebookError
Name Description
FacebookAccessTokenInvalid

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

LoginNotFound

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LogInUsingFacebookRequest, LogInUsingFacebookResponse> successCallback = (LogInUsingFacebookRequest request, LogInUsingFacebookResponse response) =>
{
    UnityEngine.Debug.Log("Successfully logged in!");
};

Action<LogInUsingFacebookRequest, LogInUsingFacebookError> errorCallback = (LogInUsingFacebookRequest request, LogInUsingFacebookError error) =>
{
    UnityEngine.Debug.Log("An error occurred while logging in: " + error.ErrorDescription);
};

var loginDesc = new LogInUsingFacebookRequestDesc(facebookAccessToken);
playerAccounts.LogInUsingFacebook(loginDesc, successCallback, errorCallback);

Log In Using Facebook

Login to the system using a FacebookAccessToken. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Available in the HTTP, iOS, Unity APIs.

Log In Using Game Center

Login to the system using a GameCenterID. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

/player/login/gamecenter

Header

Field Type Description
Game-Token

String

The Game to log in to.

Parameter

Field Type Description
GameCenterID

String

GameCenterID is provided by iOS system on calling the Social system.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

ChilliConnectSecret

String

The player's ChilliConnectSecret.

ConnectAccessToken

String

A time limited ConnectAccessToken that should be used to authenticate the player on subsequent requests.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1006

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

1013

Trial Expired. Trial Period Expired

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10001

Limit Reached. The DAU limit for today has been reached.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Log In Using Game Center

Login to the system using a GameCenterID. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

CCLogInUsingGameCenterRequest
Property Type Description
GameCenterID

NSString

GameCenterID is provided by iOS system on calling the Social system.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CCLogInUsingGameCenterResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

ChilliConnectSecret

NSString

The player's ChilliConnectSecret.

Errors

CCLogInUsingGameCenterError
Name Description
InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

LoginNotFound

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Log In Using Game Center

Login to the system using a GameCenterID. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

LogInUsingGameCenterRequest
Property Type Description
GameCenterID

string

GameCenterID is provided by iOS system on calling the Social system.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

LogInUsingGameCenterResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

ChilliConnectSecret

string

The player's ChilliConnectSecret.

Errors

LogInUsingGameCenterError
Name Description
InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

LoginNotFound

Login Not Found. The supplied player credentials were valid, but could not find a ChilliConnect player that has been linked to the account.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Log In Using Game Center

Login to the system using a GameCenterID. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Available in the HTTP, iOS, Unity APIs.

Log In Using User Name

Login to the sytem using an UserName and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

/player/login/username

Header

Field Type Description
Game-Token

String

The Game to log in to.

Parameter

Field Type Description
UserName

String

The player's Username.

Password

String

The player's Password.

DeviceModel optional

String

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

String

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

String

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

ChilliConnectSecret

String

The player's ChilliConnectSecret.

ConnectAccessToken

String

A time limited ConnectAccessToken that should be used to authenticate the player on subsequent requests.

Error 401

Code Description
1001

Invalid Game Token. The provided Game-Token was not recognised.

1005

Invalid Credentials. The supplied credentials were not recognised.

1013

Trial Expired. Trial Period Expired

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10001

Limit Reached. The DAU limit for today has been reached.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "ConnectAccessToken" : "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjEzODY4OTkxMzEsImlzcyI6ImppcmE6MTU0ODk1OTUiLCJxc2giOiI4MDYzZmY0Y2ExZTQxZGY3YmM5MGM4YWI2ZDBmNjIwN2Q0OTFjZjZkYWQ3YzY2ZWE3OTdiNDYxNGI3MTkyMmU5IiwiaWF0IjoxMzg2ODk4OTUxfQ.uKqU9dTB6gKwG6jQCuXYAiMNdfNRw98Hw_IWuA5MaMo"
 "ChilliConnectID" : "284LD4sAB5Ygo2RSl8h4vVW48qAbA8Cr",
 "ChilliConnectSecret" : "1cIVAEwPRP1czuPkqUEIQmXxwDfIVkGI"
}

Log In Using User Name

Login to the sytem using an UserName and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

CCLogInUsingUserNameRequest
Property Type Description
UserName

NSString

The player's Username.

Password

NSString

The player's Password.

DeviceModel optional

NSString

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

NSString

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

NSString

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

CCLogInUsingUserNameResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

ChilliConnectSecret

NSString

The player's ChilliConnectSecret.

Errors

CCLogInUsingUserNameError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

CCPlayerAccounts *playerAccounts = chilliConnect.playerAccounts;

CCLogInUsingUserNameResponseCallback successCallback = ^(CCLogInUsingUserNameRequest *request, CCLogInUsingUserNameResponse *response) {
    NSLog(@"Successfully logged in!");
};

CCLogInUsingUserNameErrorCallback errorCallback = ^(CCLogInUsingUserNameRequest *request, CCLogInUsingUserNameError *error) {
    NSLog(@"An error occurred while logging in: %@", error.errorDescription);
};

CCLogInUsingUserNameRequestDesc *desc = [CCLogInUsingUserNameRequestDesc logInUsingUserNameRequestDescWithUserName:@"UserName" password:@"Password"];
[playerAccounts logInUsingUserName:desc successCallback:successCallback errorCallback:errorCallback];

Log In Using User Name

Login to the sytem using an UserName and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Request

LogInUsingUserNameRequest
Property Type Description
UserName

string

The player's Username.

Password

string

The player's Password.

DeviceModel optional

string

Model of device being used by the player. E.g. SamsungABC123.

DeviceType optional

string

Type of device being used by the player. Accepted values: PHONE, TABLET, BROWSER, DESKTOP, OTHER.

Platform optional

string

Platform of the device being used by the player. A string containing one of the accepted values will be mapped to the accepted value. Accepted values: ANDROID, IOS, KINDLE, WINDOWS, MACOS, LINUX, OTHER.

Response

LogInUsingUserNameResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

ChilliConnectSecret

string

The player's ChilliConnectSecret.

Errors

LogInUsingUserNameError
Name Description
InvalidCredentials

Invalid Credentials. The supplied credentials were not recognised.

InvalidGameToken

Invalid Game Token. The provided Game-Token was not recognised.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

LimitReached

Limit Reached. The DAU limit for today has been reached.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

TrialExpired

Trial Expired. Trial Period Expired

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LogInUsingUserNameRequest, LogInUsingUserNameResponse> successCallback = (LogInUsingUserNameRequest request, LogInUsingUserNameResponse response) =>
{
    UnityEngine.Debug.Log("Successfully logged in!");
};

Action<LogInUsingUserNameRequest, LogInUsingUserNameError> errorCallback = (LogInUsingUserNameRequest request, LogInUsingUserNameError error) =>
{
    UnityEngine.Debug.Log("An error occurred while logging in: " + error.ErrorDescription);
};

var loginDesc = new LogInUsingFacebookRequestDesc("UserName", "Password");
playerAccounts.LogInUsingUserName(loginDesc, successCallback, errorCallback);

Log In Using User Name

Login to the sytem using an UserName and Password. Returns an ConnectAccessToken that is tied to the player and should be used to authenticate on subsequent requests. Also returns the ChilliConnectID and ChilliConnectSecret of the logged in player that can be used to generate new ConnectAccessTokens via the LogInUsingChilliConnect method without requiring the player to explicitly reauthenticate.

Available in the HTTP, iOS, Unity APIs.

Set Player Details

Updates the details of the currently logged in Player.

/player/update

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
UserName optional

String

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

String

A DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

String

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

String

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Success 200

Field Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

UserName

String

The UserName currently associated with the account.

DisplayName

String

The DisplayName currently associated with the account.

Email

String

The Email currently associated with the account.

Country

String

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel

Array

List of DeviceModels being used by the player.

DeviceType

String

List of DeviceTypes being used by the player.

Platform

String

List of Platforms being used by the player.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 409

Code Description
2006

UserName Taken. The supplied UserName has already taken by another player within this game.

2007

Email Taken. The supplied Email address has already taken by another player within this game.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "UserName"     : "Mike1236",
 "DisplayName"  : "Mike",
 "Email"        : "mike@mike.com"
}

Set Player Details

Updates the details of the currently logged in Player.

Request

CCSetPlayerDetailsRequest
Property Type Description
UserName optional

NSString

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

NSString

A DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

NSString

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

NSString

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Response

CCSetPlayerDetailsResponse
Property Type Description
ChilliConnectID

NSString

The ChilliConnectID of the account.

UserName optional

NSString

The UserName currently associated with the account.

DisplayName optional

NSString

The DisplayName currently associated with the account.

Email optional

NSString

The Email currently associated with the account.

Country optional

NSString

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel optional

NSArray of NSStrings

List of DeviceModels being used by the player.

DeviceType optional

NSString

List of DeviceTypes being used by the player.

Platform optional

NSString

List of Platforms being used by the player.

Errors

CCSetPlayerDetailsError
Name Description
EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

Set Player Details

Updates the details of the currently logged in Player.

Request

SetPlayerDetailsRequest
Property Type Description
UserName optional

string

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

string

A DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

string

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

string

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Response

SetPlayerDetailsResponse
Property Type Description
ChilliConnectID

string

The ChilliConnectID of the account.

UserName optional

string

The UserName currently associated with the account.

DisplayName optional

string

The DisplayName currently associated with the account.

Email optional

string

The Email currently associated with the account.

Country optional

string

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel optional

IList of strings

List of DeviceModels being used by the player.

DeviceType optional

string

List of DeviceTypes being used by the player.

Platform optional

string

List of Platforms being used by the player.

Errors

SetPlayerDetailsError
Name Description
EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

Set Player Details

Updates the details of the currently logged in Player.

Request

ChilliConnect.PlayerAccounts.setPlayerDetails( UserName DisplayName Email Password )
Parameter Type Description
UserName optional

String

The UserName of the new player account. If provided, this must be unique across all players within the game, contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

DisplayName optional

String

A DisplayName that can be used to identify the Player within the game. If provided it can contain only alpha, numeric, underscore or dash characters, and a minimum size of 3 characters, maximum 50.

Email optional

String

Email address to be associated with the new player account. If provided, this must be unique across all players within the game.

Password optional

String

Password to be assigned to the new player account. If provided must be greater than 3 and less than 50 characters in length.

Response

Attribute Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

UserName

String

The UserName currently associated with the account.

DisplayName

String

The DisplayName currently associated with the account.

Email

String

The Email currently associated with the account.

Country

String

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel

Array

List of DeviceModels being used by the player.

DeviceType

String

List of DeviceTypes being used by the player.

Platform

String

List of Platforms being used by the player.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

2006 UserNameTaken

UserName Taken. The supplied UserName has already taken by another player within this game.

2007 EmailTaken

Email Taken. The supplied Email address has already taken by another player within this game.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Examples

var newEmail = ChilliConnect.Request.Email;

//ensure there is a value prepared to accept
if( newEmail.length === 0 ) {
    return { "Success": false };
}

try {
    //pass nulls in parameters that are not to be updated
    var playerDetails = ChilliConnect.PlayerAccounts.setPlayerDetails( null, null, newEmail );
}
catch( e)
{
    if(e.isChilliConnectError && e.code === 2007) {
        ChilliConnect.Logger.error( "Email address already in use" );
        return { "Success": false };
    }

    ChilliConnect.Logger.error( "Error " + e.code + ": " + e.message );
    return { "Success": false };
}

return {
    "Success": true,
    "PlayerDetails": playerDetails
};

Get Player Details

Returns the details of the currently logged in Player.

/player/details

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Success 200

Field Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

UserName

String

The UserName currently associated with the account.

DisplayName

String

The DisplayName currently associated with the account.

Email

String

The Email currently associated with the account.

Country

String

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel

Array

List of DeviceModels being used by the player.

DeviceType

String

DeviceType being used by the player.

Platform

String

Platform being used by the player.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Examples

HTTP/1.1 200 OK
{
 "ChilliConnectID"  : "ExampleChilliConnectId123",
 "UserName"         : "Mike1236",
 "DisplayName"      : "Mike",
 "Email"            : "mike@mike.com",
 "Country"          : "GB",
 "DeviceModel"      : ["SamsungABC123"],
 "DeviceType"       : "PHONE",
 "Platform"         : "ANDROID"
}

Get Player Details

Returns the details of the currently logged in Player.

Request

CCGetPlayerDetailsRequest
Property Type Description
None

Response

CCGetPlayerDetailsResponse
Property Type Description
ChilliConnectID

NSString

The ChilliConnectID of the account.

UserName optional

NSString

The UserName currently associated with the account.

DisplayName optional

NSString

The DisplayName currently associated with the account.

Email optional

NSString

The Email currently associated with the account.

Country optional

NSString

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel optional

NSArray of NSStrings

List of DeviceModels being used by the player.

DeviceType optional

NSString

DeviceType being used by the player.

Platform optional

NSString

Platform being used by the player.

Errors

CCGetPlayerDetailsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Details

Returns the details of the currently logged in Player.

Request

GetPlayerDetailsRequest
Property Type Description
None

Response

GetPlayerDetailsResponse
Property Type Description
ChilliConnectID

string

The ChilliConnectID of the account.

UserName optional

string

The UserName currently associated with the account.

DisplayName optional

string

The DisplayName currently associated with the account.

Email optional

string

The Email currently associated with the account.

Country optional

string

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel optional

IList of strings

List of DeviceModels being used by the player.

DeviceType optional

string

DeviceType being used by the player.

Platform optional

string

Platform being used by the player.

Errors

GetPlayerDetailsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Details

Returns the details of the currently logged in Player.

Request

ChilliConnect.PlayerAccounts.getPlayerDetails( )
Parameter Type Description
None

Response

Attribute Type Description
ChilliConnectID

String

The ChilliConnectID of the account.

UserName

String

The UserName currently associated with the account.

DisplayName

String

The DisplayName currently associated with the account.

Email

String

The Email currently associated with the account.

Country

String

The Country currently associated with the account. Format: ISO 3166-1 alpha-2.

DeviceModel

Array

List of DeviceModels being used by the player.

DeviceType

String

DeviceType being used by the player.

Platform

String

Platform being used by the player.

Exceptions

Code Name Description
6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Link Facebook Account

Associate a player account with a Facebook account. Each player can only be associated with a single Facebook account and a Facebook account can only be associated with a single player per game.

If the player is already associated with a Facebook account an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the Facebook account is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and Facebook account associated with the current ChilliConnect account.

/player/link/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
FacebookAccessToken

String

Access token provided from the Facebook API.

Replace optional

Boolean

When set to true, any existing Facebook association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

Boolean

When set to true will remove any existing associations this Facebook account already has with another player of this game. Otherwise, an error will be returned. Default false.

Success 200

Field Type Description
FacebookID

String

The player's Facebook account ID.

FacebookName

String

The player's Facebook name.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 409

Code Description
2003

Player Already Linked With Facebook. The player is already associated with a Facebook account. The details of the Facebook account will be provided in the data attribute of the response body.

2004

Facebook Account Linked With Another Player. The Facebook account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

2002

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "FacebookName" : "MikeHerron",
 "FacebookID"   : "12345"
}

Link Facebook Account

Associate a player account with a Facebook account. Each player can only be associated with a single Facebook account and a Facebook account can only be associated with a single player per game.

If the player is already associated with a Facebook account an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the Facebook account is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and Facebook account associated with the current ChilliConnect account.

Request

CCLinkFacebookAccountRequest
Property Type Description
FacebookAccessToken

NSString

Access token provided from the Facebook API.

Replace optional

BOOL

When set to true, any existing Facebook association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

BOOL

When set to true will remove any existing associations this Facebook account already has with another player of this game. Otherwise, an error will be returned. Default false.

Response

CCLinkFacebookAccountResponse
Property Type Description
FacebookID

NSString

The player's Facebook account ID.

FacebookName

NSString

The player's Facebook name.

Errors

CCLinkFacebookAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

FacebookAccessTokenInvalid

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

FacebookAccountLinkedWithAnotherPlayer

Facebook Account Linked With Another Player. The Facebook account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerAlreadyLinkedWithFacebook

Player Already Linked With Facebook. The player is already associated with a Facebook account. The details of the Facebook account will be provided in the data attribute of the response body.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Link Facebook Account

Associate a player account with a Facebook account. Each player can only be associated with a single Facebook account and a Facebook account can only be associated with a single player per game.

If the player is already associated with a Facebook account an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the Facebook account is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and Facebook account associated with the current ChilliConnect account.

Request

LinkFacebookAccountRequest
Property Type Description
FacebookAccessToken

string

Access token provided from the Facebook API.

Replace optional

bool

When set to true, any existing Facebook association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

bool

When set to true will remove any existing associations this Facebook account already has with another player of this game. Otherwise, an error will be returned. Default false.

Response

LinkFacebookAccountResponse
Property Type Description
FacebookID

string

The player's Facebook account ID.

FacebookName

string

The player's Facebook name.

Errors

LinkFacebookAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

FacebookAccessTokenInvalid

Facebook Access Token Invalid. The supplied Facebook Access Token could not be validated against the Facebook API.

FacebookAccountLinkedWithAnotherPlayer

Facebook Account Linked With Another Player. The Facebook account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerAlreadyLinkedWithFacebook

Player Already Linked With Facebook. The player is already associated with a Facebook account. The details of the Facebook account will be provided in the data attribute of the response body.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Link Facebook Account

Associate a player account with a Facebook account. Each player can only be associated with a single Facebook account and a Facebook account can only be associated with a single player per game.

If the player is already associated with a Facebook account an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the Facebook account is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and Facebook account associated with the current ChilliConnect account.

Available in the HTTP, iOS, Unity APIs.

Link Game Center Account

Associate a player account with a GameCenterID. Each player can only be associated with a single GameCenterID and a GameCenterID can only be associated with a single player per game.

If the player is already associated with a GameCenterID an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the GameCenterID is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and GameCenterID associated with the current ChilliConnect account.

/player/link/gamecenter

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
GameCenterID

String

GameCenterID provided by the client.

Replace optional

Boolean

When set to true, any existing GameCenterID association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

Boolean

When set to true will remove any existing associations this GameCenterID account already has with another player of this game. Otherwise, an error will be returned. Default false.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 409

Code Description
2011

Game Center Account Linked With Another Player. The Game Center account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

2012

Player Already Linked With Game Center. The player is already associated with a GameCenter ID. The details of the Game Center account will be provided in the data attribute of the response body.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Link Game Center Account

Associate a player account with a GameCenterID. Each player can only be associated with a single GameCenterID and a GameCenterID can only be associated with a single player per game.

If the player is already associated with a GameCenterID an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the GameCenterID is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and GameCenterID associated with the current ChilliConnect account.

Request

CCLinkGameCenterAccountRequest
Property Type Description
GameCenterID

NSString

GameCenterID provided by the client.

Replace optional

BOOL

When set to true, any existing GameCenterID association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

BOOL

When set to true will remove any existing associations this GameCenterID account already has with another player of this game. Otherwise, an error will be returned. Default false.

Response

CCLinkGameCenterAccountResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

Errors

CCLinkGameCenterAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

GameCenterAccountLinkedWithAnotherPlayer

Game Center Account Linked With Another Player. The Game Center account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerAlreadyLinkedWithGameCenter

Player Already Linked With Game Center. The player is already associated with a GameCenter ID. The details of the Game Center account will be provided in the data attribute of the response body.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Link Game Center Account

Associate a player account with a GameCenterID. Each player can only be associated with a single GameCenterID and a GameCenterID can only be associated with a single player per game.

If the player is already associated with a GameCenterID an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the GameCenterID is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and GameCenterID associated with the current ChilliConnect account.

Request

LinkGameCenterAccountRequest
Property Type Description
GameCenterID

string

GameCenterID provided by the client.

Replace optional

bool

When set to true, any existing GameCenterID association for the current use will be replaced. Otherwise, an error will be returned. Default false.

Update optional

bool

When set to true will remove any existing associations this GameCenterID account already has with another player of this game. Otherwise, an error will be returned. Default false.

Response

LinkGameCenterAccountResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

Errors

LinkGameCenterAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

GameCenterAccountLinkedWithAnotherPlayer

Game Center Account Linked With Another Player. The Game Center account is already linked with another player of this game. The ChilliConnectID and ChilliConnectSecret of this player will be provided in the data attribute of the response body.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerAlreadyLinkedWithGameCenter

Player Already Linked With Game Center. The player is already associated with a GameCenter ID. The details of the Game Center account will be provided in the data attribute of the response body.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LinkGameCenterAccountRequest, LinkGameCenterAccountResponse> successCallback = (LinkGameCenterAccountRequest request, LinkGameCenterAccountResponse response) =>
{
    ChilliConnectId = response.ChilliConnectId;
    
    UnityEngine.Debug.Log("GameCenter ID linked with ChilliConnectId: " + ChilliConnectId);
};

Action<LinkGameCenterAccountRequest, LinkGameCenterAccountError> errorCallback = (LinkGameCenterAccountRequest request, LinkGameCenterAccountError error) =>
{
    UnityEngine.Debug.Log("An error occurred while linking player with account: " + error.ErrorDescription);
};

var requestDesc = new LinkGameCenterAccountDesc();

Social.localUser.Authenticate (success => {
    if (success) {
        requestDesc.GameCenterID = Social.localUser.id;

        playerAccounts.LinkGameCenterAccount(requestDesc, successCallback, errorCallback);1
    } else {
        Debug.Log("Authentication failed");
    }
});

Link Game Center Account

Associate a player account with a GameCenterID. Each player can only be associated with a single GameCenterID and a GameCenterID can only be associated with a single player per game.

If the player is already associated with a GameCenterID an error will be returned, unless the Replace flag is provided, in which case the association will be updated.

If the GameCenterID is already associated with another player within this game, an error will be returned along with the ChilliConnectID and ChilliConnectSecret for the associated player within the data parameter of the response body. If the Update flag is provided, the existing association will be removed and GameCenterID associated with the current ChilliConnect account.

Available in the HTTP, iOS, Unity APIs.

Unlink Game Center Account

Remove an associate between a player and a GameCenter account previously created via the LinkGameCenterAccount method.

/player/unlink/gamecenter

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Success 200

Field Type Description
ChilliConnectID

String

The player's ChilliConnectID.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 422

Code Description
2013

Player Not Linked To GameCenter. The current player has no linked GameCenter account.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Unlink Game Center Account

Remove an associate between a player and a GameCenter account previously created via the LinkGameCenterAccount method.

Request

CCUnlinkGameCenterAccountRequest
Property Type Description
None

Response

CCUnlinkGameCenterAccountResponse
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

Errors

CCUnlinkGameCenterAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerNotLinkedToGameCenter

Player Not Linked To GameCenter. The current player has no linked GameCenter account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Unlink Game Center Account

Remove an associate between a player and a GameCenter account previously created via the LinkGameCenterAccount method.

Request

UnlinkGameCenterAccountRequest
Property Type Description
None

Response

UnlinkGameCenterAccountResponse
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

Errors

UnlinkGameCenterAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerNotLinkedToGameCenter

Player Not Linked To GameCenter. The current player has no linked GameCenter account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Unlink Game Center Account

Remove an associate between a player and a GameCenter account previously created via the LinkGameCenterAccount method.

Available in the HTTP, iOS, Unity APIs.

Verify Facebook Token

Retrieve a boolean indicating if a player's Facebook Access Token is Valid or not.

/player/verify/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Success 200

Field Type Description
Valid

Boolean

Whether the access token currently stored is valid or not.

FacebookID

String

The player's Facebook account ID.

FacebookName

String

The player's Facebook name.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 422

Code Description
2005

Player Not Linked To Facebook. The current player has no linked Facebook account.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Examples

HTTP/1.1 200 OK
{
 "Valid"         : true
 "FacebookID"    : "12345"
 "FacebookName"  : "Steve"
}

Verify Facebook Token

Retrieve a boolean indicating if a player's Facebook Access Token is Valid or not.

Request

CCVerifyFacebookTokenRequest
Property Type Description
None

Response

CCVerifyFacebookTokenResponse
Property Type Description
Valid

BOOL

Whether the access token currently stored is valid or not.

FacebookID

NSString

The player's Facebook account ID.

FacebookName

NSString

The player's Facebook name.

Errors

CCVerifyFacebookTokenError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Verify Facebook Token

Retrieve a boolean indicating if a player's Facebook Access Token is Valid or not.

Request

VerifyFacebookTokenRequest
Property Type Description
None

Response

VerifyFacebookTokenResponse
Property Type Description
Valid

bool

Whether the access token currently stored is valid or not.

FacebookID

string

The player's Facebook account ID.

FacebookName

string

The player's Facebook name.

Errors

VerifyFacebookTokenError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Verify Facebook Token

Retrieve a boolean indicating if a player's Facebook Access Token is Valid or not.

Available in the HTTP, iOS, Unity APIs.

Lookup Facebook Players

Find the ChilliConnectIDs of players associated with provided FacebookIDs. Returns an array of objects for each FacebookID that was found providing the FacebookName, ChilliConnectID, UserName and DisplayName of the associated player.

/player/lookup/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
FacebookIDs

Array

An array of FacebookIDs to look up. Maximum 10.

Success 200

Field Type Description
Players

Array

A list of players.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookID

String

The player's Facebook ID.

  FacebookName

String

The player's Facebook Name.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Lookup Facebook Players

Find the ChilliConnectIDs of players associated with provided FacebookIDs. Returns an array of objects for each FacebookID that was found providing the FacebookName, ChilliConnectID, UserName and DisplayName of the associated player.

Request

CCLookupFacebookPlayersRequest
Property Type Description
FacebookIDs

NSArray of NSStrings

An array of FacebookIDs to look up. Maximum 10.

Response

CCLookupFacebookPlayersResponse
Property Type Description
Players

NSArray of CCFacebookPlayers

A list of players.

Objects

CCFacebookPlayer
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

FacebookID

NSString

The player's Facebook ID.

FacebookName

NSString

The player's Facebook Name.

Errors

CCLookupFacebookPlayersError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Lookup Facebook Players

Find the ChilliConnectIDs of players associated with provided FacebookIDs. Returns an array of objects for each FacebookID that was found providing the FacebookName, ChilliConnectID, UserName and DisplayName of the associated player.

Request

LookupFacebookPlayersRequest
Property Type Description
FacebookIDs

IList of strings

An array of FacebookIDs to look up. Maximum 10.

Response

LookupFacebookPlayersResponse
Property Type Description
Players

IList of FacebookPlayers

A list of players.

Objects

FacebookPlayer
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

FacebookID

string

The player's Facebook ID.

FacebookName

string

The player's Facebook Name.

Errors

LookupFacebookPlayersError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Lookup Facebook Players

Find the ChilliConnectIDs of players associated with provided FacebookIDs. Returns an array of objects for each FacebookID that was found providing the FacebookName, ChilliConnectID, UserName and DisplayName of the associated player.

Request

ChilliConnect.PlayerAccounts.lookupFacebookPlayers( FacebookIds )
Parameter Type Description
FacebookIDs

Array

An array of FacebookIDs to look up. Maximum 10.

Response

Attribute Type Description
Players

Array

A list of players.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookID

String

The player's Facebook ID.

  FacebookName

String

The player's Facebook Name.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Lookup User Names

Find the ChilliConnectIDs of players associated with provided UserNames. Returns an array of objects for each UserName that was found providing the ChilliConnectID, UserName and DisplayName of the associated player.

/player/lookup/username

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
UserNames

Array

An array of UserNames to look up. Maximum 10.

Success 200

Field Type Description
Players

Array

A list of players.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Lookup User Names

Find the ChilliConnectIDs of players associated with provided UserNames. Returns an array of objects for each UserName that was found providing the ChilliConnectID, UserName and DisplayName of the associated player.

Request

CCLookupUserNamesRequest
Property Type Description
UserNames

NSArray of NSStrings

An array of UserNames to look up. Maximum 10.

Response

CCLookupUserNamesResponse
Property Type Description
Players

NSArray of CCPlayers

A list of players.

Objects

CCPlayer
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

Errors

CCLookupUserNamesError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Lookup User Names

Find the ChilliConnectIDs of players associated with provided UserNames. Returns an array of objects for each UserName that was found providing the ChilliConnectID, UserName and DisplayName of the associated player.

Request

LookupUserNamesRequest
Property Type Description
UserNames

IList of strings

An array of UserNames to look up. Maximum 10.

Response

LookupUserNamesResponse
Property Type Description
Players

IList of Players

A list of players.

Objects

Player
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

Errors

LookupUserNamesError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var playerAccounts = chilliConnect.PlayerAccounts;

Action<LookupUserNamesRequest, LookupUserNamesResponse> successCallback = (LookupUserNamesRequest request, LookupUserNamesResponse response) =>
{
	if(response.Players.Count == 0)
	{
		UnityEngine.Debug.Log("No player found for the usernames provided.");
	}
	else
	{
		foreach(var player in response.Players)
		{
			UnityEngine.Debug.Log("Player data retrieved! ChilliConnectID: " + player.ChilliConnectId);
		}
	}
};

Action<LookupUserNamesRequest, LookupUserNamesError> errorCallback = (LookupUserNamesRequest request, LookupUserNamesError error) =>
{
	UnityEngine.Debug.Log("An error occurred while getting player data: " + error.ErrorDescription);
};

playerAccounts.LookupUserNames(new List<string>() { "UserTest", "UserTest2" }, successCallback, errorCallback);

Lookup User Names

Find the ChilliConnectIDs of players associated with provided UserNames. Returns an array of objects for each UserName that was found providing the ChilliConnectID, UserName and DisplayName of the associated player.

Request

ChilliConnect.PlayerAccounts.lookupUserNames( UserNames )
Parameter Type Description
UserNames

Array

An array of UserNames to look up. Maximum 10.

Response

Attribute Type Description
Players

Array

A list of players.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Get Facebook Friends

Get back a players ChilliConnect registered Facebook friends along with their current Facebook profile pictures.

/player/friends/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Success 200

Field Type Description
Friends

Array

A list of the players Facebook friends.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookID

String

The player's FacebookID.

  FacebookName

String

The player's Facebook Name.

  FacebookProfileImage

String

The player's Facebook profile image URL.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 422

Code Description
2005

Player Not Linked To Facebook. The current player has no linked Facebook account.

2008

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Examples

HTTP/1.1 200 OK
{
  "Friends" : [
     {
         "ChilliConnectID"       : "9U2durFcO1pcDCZ3OoGezPNCtq1rBaWl"
         "DisplayName"           : "Steve"
         "UserName"              : "Steve"
         "DateLogin"             : null
         "FacebookID"            : "3452314523456"
         "FacebookName"          : "Steve"
         "FacebookProfileImage"  : "http://image.at.facebook"
     },
     {
         "ChilliConnectID"       : "3RtydfFcO1pcDCX4OoGezPNCtq1Vg67J"
         "DisplayName"           : "Richard"
         "UserName"              : "Rich"
         "DateLogin"             : null
         "FacebookID"            : "5452224523489"
         "FacebookName"          : "Rich"
         "FacebookProfileImage"  : "http://image.at.facebook.2"
     }
 ]
}

Get Facebook Friends

Get back a players ChilliConnect registered Facebook friends along with their current Facebook profile pictures.

Request

CCGetFacebookFriendsRequest
Property Type Description
None

Response

CCGetFacebookFriendsResponse
Property Type Description
Friends

NSArray of CCFacebookPlayerWithProfileImages

A list of the players Facebook friends.

Objects

CCFacebookPlayerWithProfileImage
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

FacebookID

NSString

The player's FacebookID.

FacebookName

NSString

The player's Facebook Name.

FacebookProfileImage

NSString

The player's Facebook profile image URL.

Errors

CCGetFacebookFriendsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Facebook Friends

Get back a players ChilliConnect registered Facebook friends along with their current Facebook profile pictures.

Request

GetFacebookFriendsRequest
Property Type Description
None

Response

GetFacebookFriendsResponse
Property Type Description
Friends

IList of FacebookPlayerWithProfileImages

A list of the players Facebook friends.

Objects

FacebookPlayerWithProfileImage
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

FacebookID

string

The player's FacebookID.

FacebookName

string

The player's Facebook Name.

FacebookProfileImage

string

The player's Facebook profile image URL.

Errors

GetFacebookFriendsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Facebook Friends

Get back a players ChilliConnect registered Facebook friends along with their current Facebook profile pictures.

Request

ChilliConnect.PlayerAccounts.getFacebookFriends( )
Parameter Type Description
None

Response

Attribute Type Description
Friends

Array

A list of the players Facebook friends.

  ChilliConnectID

String

The player's ChilliConnectID.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookID

String

The player's FacebookID.

  FacebookName

String

The player's Facebook Name.

  FacebookProfileImage

String

The player's Facebook profile image URL.

Exceptions

Code Name Description
2005 PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

2008 UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Unlink Facebook Account

Remove an associate between a player and a Facebook account previously created via the LinkFacebookAccount method.

/player/unlink/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Success 200

Field Type Description
FacebookID

String

The player's Facebook ID of the unlinked account.

FacebookName

String

The player's Facebook name of the unlinked account.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 422

Code Description
2005

Player Not Linked To Facebook. The current player has no linked Facebook account.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "FacebookName" : "MikeHerron",
 "FacebookID"   : "12345"
}

Unlink Facebook Account

Remove an associate between a player and a Facebook account previously created via the LinkFacebookAccount method.

Request

CCUnlinkFacebookAccountRequest
Property Type Description
None

Response

CCUnlinkFacebookAccountResponse
Property Type Description
FacebookID

NSString

The player's Facebook ID of the unlinked account.

FacebookName

NSString

The player's Facebook name of the unlinked account.

Errors

CCUnlinkFacebookAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Unlink Facebook Account

Remove an associate between a player and a Facebook account previously created via the LinkFacebookAccount method.

Request

UnlinkFacebookAccountRequest
Property Type Description
None

Response

UnlinkFacebookAccountResponse
Property Type Description
FacebookID

string

The player's Facebook ID of the unlinked account.

FacebookName

string

The player's Facebook name of the unlinked account.

Errors

UnlinkFacebookAccountError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Unlink Facebook Account

Remove an associate between a player and a Facebook account previously created via the LinkFacebookAccount method.

Available in the HTTP, iOS, Unity APIs.

As Player

Execute the callback function within the context of the provided ChilliConnectID, allowing Cloud Code scripts to access and modify player accounts other than the currently logged in player. Any other API methods invoked within the callback will be executed as if the player identified by the supplied ChilliConnectID is logged in.

Available in the Script API.

As Player

Execute the callback function within the context of the provided ChilliConnectID, allowing Cloud Code scripts to access and modify player accounts other than the currently logged in player. Any other API methods invoked within the callback will be executed as if the player identified by the supplied ChilliConnectID is logged in.

Available in the Script API.

As Player

Execute the callback function within the context of the provided ChilliConnectID, allowing Cloud Code scripts to access and modify player accounts other than the currently logged in player. Any other API methods invoked within the callback will be executed as if the player identified by the supplied ChilliConnectID is logged in.

Available in the Script API.

As Player

Execute the callback function within the context of the provided ChilliConnectID, allowing Cloud Code scripts to access and modify player accounts other than the currently logged in player. Any other API methods invoked within the callback will be executed as if the player identified by the supplied ChilliConnectID is logged in.

Request

ChilliConnect.PlayerAccounts.asPlayer( ChilliConnectId Callback )
Parameter Type Description
ChilliConnectID

String

The ChilliConnectID of the player that the callback should be executed as.

Callback

Function

The Javascript callback function to execute.

Exceptions

Code Name Description
1009 PlayerNotFound

Player Not Found. The player specified was not found.

Examples

var LeaderboardKey = "SCORES";

var error = null;
var topPlayer = null;
var addScoreResponse = null;

try {
    
    /**
     * Check if there is an existing top score and if there is, store the ChilliConnectID
     */
    var scores = ChilliConnect.Leaderboards.getScores( LeaderboardKey );
    if ( scores.Total > 0 ) {
        topPlayer = scores.Scores[0].ChilliConnectID;
    }
    
    /**
     * Add the new score as usual
     */
    addScoreResponse = ChilliConnect.Leaderboards.addScore( ChilliConnect.Request.Score, LeaderboardKey );
    
    var playerDetails = ChilliConnect.PlayerAccounts.getPlayerDetails();
    
    /**
     * If the new score is top, and there was a previous score...
     */ 
    if ( addScoreResponse.GlobalRank === 1 && topPlayer !== null && playerDetails.ChilliConnectID !=topPlayer ) {
        
        /**
         * Send the displaced player a Push Notification
         */ 
        ChilliConnect.PlayerAccounts.asPlayer( topPlayer, 
            function() {
                ChilliConnect.PushNotifications.sendToPlayer( "{ 'message': 'Your top score was beaten!' } " );
            }
        );
    }

}
catch( e ) {
    error = e;
}

return {
    "Success"   : error === null,
    "Error"     : error,
    "Response"  : addScoreResponse
}

Cloud Data

The ChilliConnect Cloud Data module. Provides the means to store custom data against Player Accounts for retrieval.

Set Player Data

Sets the value of a specified Custom Data Key for the currently logged in player.

/data/player/set

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Custom Data Key to set value of. Maximum length is 50 characters.

Value

JSON

The value the Custom Data Key should be set to. When serialised the maximum size is 7kb.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value, or "1" for the initial write. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Attachment optional

String

The attachment data to be saved to the Custom Data Key. The maximum size is 2mb. To remove Attachment Data set to empty string.

Success 200

Field Type Description
WriteLock

String

Identifier for this write to the Custom Data item.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 409

Code Description
7001

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Error 507

Code Description
7002

Player Cloud Data Key Limit Reached. Fulfilling this request would exceed the number of keys each player is allowed to have. This limit is 10.

Examples

{
 "ChilliConnectID" : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
 "Key" : "PlayerRating",
 "Value" : "Good"
}
{
 "ChilliConnectID" : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
 "Key" : "PlayerRating",
 "Value" : "Good",
 "WriteLock" : "4"
}
HTTP/1.1 200 OK
{
 "WriteLock" : "5"
}
HTTP/1.1 409 Conflict
{
 "Error" : "Conflict",
 "Code" : 7003,
 "Data" : {
      "Attempted" :
          {   "ChilliConnectID" : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
              "Key" : "PlayerRating",
              "Value" : "Good",
              "WriteLock" : "4"
          },
      "Existing" :
          {   "ChilliConnectID" : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
              "Key" : "PlayerRating",
              "Value" : "Fair",
              "WriteLock" : "5",
              "DateModified" : "2015-11-11T12:02:01",
              "DateCreated" : "2015-11-10T09:21:54",
          },
  ]
}
HTTP/1.1 507 Insufficient Storage
{
 "Error" : Player Storage Key Limit Reached",
 "Code" : 7004,
 "Data" : {
      "UsedKeys" :
          [   "Alpha",
              "Beta",
              "Gamma",
              "Delta",
              "Epsilon",
              "Zeta",
              "Eta",
              "Theta",
              "Iota",
              "Kappa"
          ]
  }
}

Set Player Data

Sets the value of a specified Custom Data Key for the currently logged in player.

Request

CCSetPlayerDataRequest
Property Type Description
Key

NSString

The Custom Data Key to set value of. Maximum length is 50 characters.

Value

SCMultiTypeValue

The value the Custom Data Key should be set to. When serialised the maximum size is 7kb.

WriteLock optional

NSString

To enable conflict checking provide the previous WriteLock value, or "1" for the initial write. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Attachment optional

NSString

The attachment data to be saved to the Custom Data Key. The maximum size is 2mb. To remove Attachment Data set to empty string.

Response

CCSetPlayerDataResponse
Property Type Description
WriteLock

NSString

Identifier for this write to the Custom Data item.

Errors

CCSetPlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerDataKeyLimitReached

Player Cloud Data Key Limit Reached. Fulfilling this request would exceed the number of keys each player is allowed to have. This limit is 10.

PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

SCMultiTypeArrayBuilder *scoresBuilder = [SCMultiTypeArrayBuilder multiTypeArrayBuilder];
[scoresBuilder addNumber:@82.0f];
[scoresBuilder addNumber:@87.0f];
[scoresBuilder addNumber:@65.0f];

SCMultiTypeDictionaryBuilder *characterDataBuilder = [SCMultiTypeDictionaryBuilder multiTypeDictionaryBuilder];
[characterDataBuilder addString:@"John" forKey:@"CharacterName"];
[characterDataBuilder addArray:[scoresBuilder build] forKey:@"Scores"];

SCMultiTypeValue *characterData = [SCMultiTypeValue multiTypeValueWithDictionary:[characterDataBuilder build]];

CCCloudData *cloudData = chilliConnect.cloudData;

CCSetPlayerDataResponseCallback successCallback = ^(CCSetPlayerDataRequest *request, CCSetPlayerDataResponse* response) {
    NSLog(@"Player data set successfully!");
};

CCSetPlayerDataErrorCallback errorCallback = ^(CCSetPlayerDataRequest *request, CCSetPlayerDataError* error) {
    NSLog(@"Failed to set player data due to error: %@", error.errorDescription);
};

CCSetPlayerDataRequestDesc *desc = [CCSetPlayerDataRequestDesc setPlayerDataRequestDescWithKey:@"CharacterData" value:characterData];
[cloudData setPlayerDataWithDesc:desc successCallback:successCallback errorCallback:errorCallback];
CCSCloudData *cloudData = chilliConnect.cloudData;

CCSetPlayerDataResponseCallback successCallback = ^(CCSetPlayerDataRequest *request, CCSetPlayerDataResponse* response) {
    NSLog(@"Player data set successfully!");
};

CCSetPlayerDataErrorCallback errorCallback = ^(CCSetPlayerDataRequest *request, CCSetPlayerDataError* error) {
    if (error.errorCode == CCSetPlayerDataErrorCodePlayerDataWriteConflict) {
        NSDictionary *existing = error.errorData[@"Existing"];
        NSString *existingValue = existing[@"Value"];
        NSString *existingWriteLock = existing[@"WriteLock"];
        
        NSDictionary *attempted = error.errorData[@"Attempted"];
        NSString *attemptedValue = attempted[@"Value"];
        NSString *attemptedWriteLock = attempted[@"WriteLock"];
        
        NSLog(@"Could not write player data because a conflict has occurred. Attempted to overwrite '%@' (Write lock %@) with '%@' (Write lock %@)", existingValue, existingWriteLock, attemptedValue, attemptedWriteLock);
    }
};

CCSetPlayerDataRequestDesc *desc = [CCSetPlayerDataRequestDesc setPlayerDataRequestDescWithKey:@"CharacterData" value:[SCMultiTypeValue multiTypeValueWithString:@"NewValue"]];
desc.writeLock = @"1";
[cloudData setPlayerDataWithDesc:desc successCallback:successCallback errorCallback:errorCallback];

Set Player Data

Sets the value of a specified Custom Data Key for the currently logged in player.

Request

SetPlayerDataRequest
Property Type Description
Key

string

The Custom Data Key to set value of. Maximum length is 50 characters.

Value

MultiTypeValue

The value the Custom Data Key should be set to. When serialised the maximum size is 7kb.

WriteLock optional

string

To enable conflict checking provide the previous WriteLock value, or "1" for the initial write. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Attachment optional

string

The attachment data to be saved to the Custom Data Key. The maximum size is 2mb. To remove Attachment Data set to empty string.

Response

SetPlayerDataResponse
Property Type Description
WriteLock

string

Identifier for this write to the Custom Data item.

Errors

SetPlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerDataKeyLimitReached

Player Cloud Data Key Limit Reached. Fulfilling this request would exceed the number of keys each player is allowed to have. This limit is 10.

PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var scoreList = new MultiTypeListBuilder().Add(82.0f).Add(87.0f).Add(65.0f).Build();
var characterData = new MultiTypeDictionaryBuilder().Add("CharacterName", "John").Add("Scores", scoreList).Build();

var cloudData = chilliConnect.CloudData;

Action<SetPlayerDataRequest, SetPlayerDataResponse> successCallback = (SetPlayerDataRequest request, SetPlayerDataResponse response) =>
{
    UnityEngine.Debug.Log("Player data set successfully!");
};

Action<SetPlayerDataRequest, SetPlayerDataError> errorCallback = (SetPlayerDataRequest request, SetPlayerDataError error) =>
{
    UnityEngine.Debug.Log("An error occurred while setting player data: " + error.ErrorDescription);
};

var requestDesc = new SetPlayerDataRequestDesc("CharacterData", characterData);
cloudData.SetPlayerData(requestDesc, successCallback, errorCallback);
var storage = chilliConnect.Storage;

Action<SetPlayerDataRequest, SetPlayerDataResponse> successCallback = (SetPlayerDataRequest request, SetPlayerDataResponse response) =>
{
    UnityEngine.Debug.Log("Player data set successfully!");
};

Action<SetPlayerDataRequest, SetPlayerDataError> errorCallback = (SetPlayerDataRequest request, SetPlayerDataError error) =>
{
    if (error.ErrorCode == SetPlayerDataError.Error.PlayerDataWriteConflict)
    {
        const string JsonKeyExisting = "Existing";
        const string JsonKeyAttempted = "Attempted";
        const string JsonKeyValue = "Value";
        const string JsonKeyWriteLock = "WriteLock";
        
        var existing = error.ErrorData[JsonKeyExisting] as IDictionary<string, object>;
        var existingValue = existing[JsonKeyValue] as string;
        var existingWriteLock = existing[JsonKeyWriteLock] as string;
        
        var attempted = error.ErrorData[JsonKeyAttempted] as IDictionary<string, object>;
        var attemptedValue = attempted[JsonKeyValue] as string;
        var attemptedWriteLock = attempted[JsonKeyWriteLock] as string;
        
        UnityEngine.Debug.Log("Could not write player data because a conflict occurred.");
        UnityEngine.Debug.Log("Attempted to overwrite '" + existingValue + "' (Write lock " + existingWriteLock + ") with '" + attemptedValue + "' (Write lock " + attemptedWriteLock + ")");
    }
};

var requestDesc = new SetPlayerDataRequestDesc("CharacterData", "NewValue");
requestDesc.WriteLock = "1";
storage.SetPlayerData(requestDesc, successCallback, errorCallback);

Set Player Data

Sets the value of a specified Custom Data Key for the currently logged in player.

Request

ChilliConnect.CloudData.setPlayerData( Key Value WriteLock Attachment )
Parameter Type Description
Key

String

The Custom Data Key to set value of. Maximum length is 50 characters.

Value

JSON

The value the Custom Data Key should be set to. When serialised the maximum size is 7kb.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value, or "1" for the initial write. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Attachment optional

String

The attachment data to be saved to the Custom Data Key. The maximum size is 2mb. To remove Attachment Data set to empty string.

Response

Attribute Type Description
WriteLock

String

Identifier for this write to the Custom Data item.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

7001 PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

7002 PlayerDataKeyLimitReached

Player Cloud Data Key Limit Reached. Fulfilling this request would exceed the number of keys each player is allowed to have. This limit is 10.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Examples

var newItem = ChilliConnect.Request.Item; //e.g. { "Name": "Rope", "Rate": 7 }

//ensure there is a value prepared to accept
if( !newItem.hasOwnProperty( "Name" ) || !newItem.hasOwnProperty( "Rate" ) ) {
    return { "Success": false };
}

var rucksackStorageKey = "Rucksack";
var getPlayerDataResponse = ChilliConnect.CloudData.getPlayerData( [ rucksackStorageKey ] );

var rucksackContents = getPlayerDataResponse.Values[0].Value;

rucksackContents.push( newItem );

try {
    ChilliConnect.CloudData.setPlayerData( "Rucksack", rucksackContents );
}
catch( e )
{
    ChilliConnect.Logger.error( "Error " + e.code + ": " + e.message );
    return { "Success": false };
}

return {
    "Success": true,
    "Rucksack": rucksackContents
};
var newItem = ChilliConnect.Request.Item; //e.g. { "Name": "Rope", "Rate": 7 }
var writeId = ChilliConnect.Request.WriteId;

//ensure there is a value prepared to accept
if( !newItem.hasOwnProperty( "Name" ) || !newItem.hasOwnProperty( "Rate" ) ) {
    return { "Success": false };
}

var rucksackContents = getRucksackContents();

rucksackContents.push( newItem );

try {
    var saveRucksackResponse = ChilliConnect.CloudData.setPlayerData( "Rucksack", rucksackContents, writeId );
}
catch( e )
{
    if( e.isChilliConnectError && e.code === 7001 ) {
        //return the details to update and repeat the request
        return {
            "Success": false,
            "CurrentRucksack": e.data.Existing.Value,
            "CurrentWriteId": e.data.Existing.WriteLock
        };
    }

    ChilliConnect.Logger.error( "Error " + e.code + ": " + e.message );
    return { "Success": false };
}

return {
    "Success": true,
    "Rucksack": rucksackContents,
    "NewWriteId": saveRucksackResponse.WriteLock
};

function getRucksackContents() {
    var response = ChilliConnect.CloudData.getPlayerData( [ "Rucksack" ] );

    if(response.Values.length === 0 || !Array.isArray( response.Values[0].Value )) {
        return [];
    }

    return response.Values[0].Value;
}

Set Player Data For Chilli Connect Id

Sets the value of a specified Custom Data Key for the player identified by the ChilliConnectID.

Available in the Script API.

Set Player Data For Chilli Connect Id

Sets the value of a specified Custom Data Key for the player identified by the ChilliConnectID.

Available in the Script API.

Set Player Data For Chilli Connect Id

Sets the value of a specified Custom Data Key for the player identified by the ChilliConnectID.

Available in the Script API.

Set Player Data For Chilli Connect Id

Sets the value of a specified Custom Data Key for the player identified by the ChilliConnectID.

Request

ChilliConnect.CloudData.setPlayerDataForChilliConnectId( ChilliConnectId Key Value WriteLock Attachment )
Parameter Type Description
ChilliConnectID

String

ChillIConnectID for the player.

Key

String

The Custom Data Key to set value of. Maximum length is 50 characters.

Value

JSON

The value the Custom Data Key should be set to. When serialised the maximum size is 7kb.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value, or "1" for the initial write. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Attachment optional

String

The attachment data to be saved to the Custom Data Key. The maximum size is 2mb. To remove Attachment data set to empty string.

Response

Attribute Type Description
WriteLock

String

Identifier for this write to the Custom Data item.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

1009 PlayerNotFound

Player Not Found. The player specified was not found.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

7001 PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

7002 PlayerDataKeyLimitReached

Player Cloud Data Key Limit Reached. Fulfilling this request would exceed the number of keys each player is allowed to have. This limit is 10.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Get Player Data

Returns the value of a set of specified Custom Data Keys for the currently logged in player.

/data/player/get

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Keys

Array

The Custom Data Keys for which to retrieve the values of.

Success 200

Field Type Description
Values

Array

An array of values for each of the provided Keys.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  WriteLock

String

The current value of the WriteLock for this Key. To enable conflict checking, the returned WriteLock can be provided to the Add Data call on subsequent update attempts.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "Values" : [
   {
     "Key"           : "testKeyAlpha",
     "Value"         : "testValueAlpha",
     "WriteLock"     : "2",
     "DateCreated"   : "2015-11-10T12:12:10",
     "DateModified"  : "2015-11-11T16:53:02"
   },
   {
     "Key"           : "testKeyBeta",
     "Value"         : "testValueBeta",
     "WriteLock"     : "2",
     "DateCreated"   : "2015-11-10T12:12:10",
     "DateModified"  : "2015-11-11T16:53:02"
   }
 ]

Get Player Data

Returns the value of a set of specified Custom Data Keys for the currently logged in player.

Request

CCGetPlayerDataRequest
Property Type Description
Keys

NSArray of NSStrings

The Custom Data Keys for which to retrieve the values of.

Response

CCGetPlayerDataResponse
Property Type Description
Values

NSArray of CCPlayerDatas

An array of values for each of the provided Keys.

Objects

CCPlayerData
Property Type Description
Key

NSString

The requested Custom Data Key.

Value

SCMultiTypeValue

The value of the Custom Data Key.

HasAttachment

BOOL

True if the Key has Attachment data associated with it.

WriteLock

NSString

The current value of the WriteLock for this Key. To enable conflict checking, the returned WriteLock can be provided to the Add Data call on subsequent update attempts.

DateCreated

NSDate

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

NSDate

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

CCGetPlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

CCCloudData *cloudData = chilliConnect.cloudData;

CCGetPlayerDataResponseCallback successCallback = ^(CCGetPlayerDataRequest *request, CCGetPlayerDataResponse* response) {
    if (response.values.count == 0) {
        NSLog(@"No data for the requested player data key.");
    } else {
        NSAssert([response.values[0] isKindOfClass:[CCPlayerData class]], @"Player data array contains incorrect class type.");
        
        CCPlayerData *playerData = response.values[0];
        SCMultiTypeDictionary *characterData = playerData.value.dictionaryValue;
        
        NSString *name = [characterData stringForKey:@"CharacterName"];
        SCMultiTypeArray *scores = [characterData arrayForKey:@"Scores"];
        
        NSLog(@"Character Name: %@", name);
        NSLog(@"Scores:");
        for (SCMultiTypeValue *value in scores) {
            NSLog(@"    %@", value.numberValue);
        }
    }
};

CCGetPlayerDataErrorCallback errorCallback = ^(CCGetPlayerDataRequest *request, CCGetPlayerDataError* error) {
    NSLog(@"Failed to get player data due to error: %@", error.errorDescription);
};

[cloudData getPlayerDataWithKeys:@[ @"CharacterData" ] successCallback:successCallback errorCallback:errorCallback];

Get Player Data

Returns the value of a set of specified Custom Data Keys for the currently logged in player.

Request

GetPlayerDataRequest
Property Type Description
Keys

IList of strings

The Custom Data Keys for which to retrieve the values of.

Response

GetPlayerDataResponse
Property Type Description
Values

IList of PlayerDatas

An array of values for each of the provided Keys.

Objects

PlayerData
Property Type Description
Key

string

The requested Custom Data Key.

Value

MultiTypeValue

The value of the Custom Data Key.

HasAttachment

bool

True if the Key has Attachment data associated with it.

WriteLock

string

The current value of the WriteLock for this Key. To enable conflict checking, the returned WriteLock can be provided to the Add Data call on subsequent update attempts.

DateCreated

DateTime

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

DateTime

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

GetPlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Examples

var cloudData = chilliConnect.cloudData;

Action<GetPlayerDataRequest, GetPlayerDataResponse> successCallback = (GetPlayerDataRequest request, GetPlayerDataResponse response) =>
{
    if (response.Values.Count == 0)
    {
        UnityEngine.Debug.Log("No data for the requested cloud player data key.");
        return;
    }

    var playerData = response.Values[0];
    var characterData = playerData.Value.AsDictionary();
    var characterName = characterData.GetString("CharacterName");
    var scores = characterData.GetList("Scores");

    UnityEngine.Debug.Log("Character Name: " + characterName);
    UnityEngine.Debug.Log("Scores: ");
    foreach (var score in scores)
    {
        UnityEngine.Debug.Log("    " + score.AsInt());
    }
};

Action<GetPlayerDataRequest, GetPlayerDataError> errorCallback = (GetPlayerDataRequest request, GetPlayerDataError error) =>
{
    UnityEngine.Debug.Log("An error occurred while getting player data: " + error.ErrorDescription);
};

var keys = new List<string>() { "CharacterData" };
cloudData.GetPlayerData(keys, successCallback, errorCallback);

Get Player Data

Returns the value of a set of specified Custom Data Keys for the currently logged in player.

Request

ChilliConnect.CloudData.getPlayerData( Keys )
Parameter Type Description
Keys

Array

The Custom Data Keys for which to retrieve the values of.

Response

Attribute Type Description
Values

Array

An array of values for each of the provided Keys.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  WriteLock

String

The current value of the WriteLock for this Key. To enable conflict checking, the returned WriteLock can be provided to the Add Data call on subsequent update attempts.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Examples

var newItem = ChilliConnect.Request.Item; //e.g. { "Name": "Rope", "Rate": 7 }

//ensure there is a value prepared to accept
if( !newItem.hasOwnProperty( "Name" ) || !newItem.hasOwnProperty( "Rate" ) ) {
    return { "Success": false };
}

var rucksackStorageKey = "Rucksack";
var getPlayerDataResponse = ChilliConnect.CloudData.getPlayerData( [ rucksackStorageKey ] );

var rucksackContents = getPlayerDataResponse.Values[0].Value;

rucksackContents.push( newItem );

try {
    ChilliConnect.CloudData.setPlayerData( "Rucksack", rucksackContents );
}
catch( e )
{
    ChilliConnect.Logger.error( "Error " + e.code + ": " + e.message );
    return { "Success": false };
}

return {
    "Success": true,
    "Rucksack": rucksackContents
};

Get Player Data For Chilli Connect Ids

Returns the value of a specified Custom Data Key for a list of provided ChilliConnectIDs.

/data/player/get/chilli

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Custom Data Key to return.

ChilliConnectIDs

Array

A list of ChillIConnectIDs for which to retrieve Custom Data values. Maximum 10.

IncludeMe optional

Boolean

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Success 200

Field Type Description
Values

Array

An array of Keys and Values along with their associated ChilliConnectIDs.

  ChilliConnectID

String

The player's ChilliConnectID.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "Values": [
   {
     "ChilliConnectID"   : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
     "Key"               : "LastChar",
     "Value"             : "testValue"
     "UserName"          : "UserTwo",
     "DisplayName"       : "User"
     "DateCreated"       : "2015-11-10T12:12:10",
     "DateModified"      : "2015-11-11T16:53:02"
   },
   {
     "ChilliConnectID"   : "0ZbkBDasdadaw3r32nW19L9dLo234aAd",
     "Key"               : "testKey",
     "Value"             : "testValueOne"
     "UserName"          : "UserOne",
     "DisplayName"       : "User"
     "DateCreated"       : "2015-11-10T12:12:10",
     "DateModified"      : "2015-11-11T16:53:02"
   }
 ]
}

Get Player Data For Chilli Connect Ids

Returns the value of a specified Custom Data Key for a list of provided ChilliConnectIDs.

Request

CCGetPlayerDataForChilliConnectIdsRequest
Property Type Description
Key

NSString

The Custom Data Key to return.

ChilliConnectIDs

NSArray of NSStrings

A list of ChillIConnectIDs for which to retrieve Custom Data values. Maximum 10.

IncludeMe optional

BOOL

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

CCGetPlayerDataForChilliConnectIdsResponse
Property Type Description
Values

NSArray of CCChilliConnectPlayerDatas

An array of Keys and Values along with their associated ChilliConnectIDs.

Objects

CCChilliConnectPlayerData
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

Key

NSString

The requested Custom Data Key.

Value

SCMultiTypeValue

The value of the Custom Data Key.

HasAttachment

BOOL

True if the Key has Attachment data associated with it.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

DateCreated

NSDate

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

NSDate

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

CCGetPlayerDataForChilliConnectIdsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data For Chilli Connect Ids

Returns the value of a specified Custom Data Key for a list of provided ChilliConnectIDs.

Request

GetPlayerDataForChilliConnectIdsRequest
Property Type Description
Key

string

The Custom Data Key to return.

ChilliConnectIDs

IList of strings

A list of ChillIConnectIDs for which to retrieve Custom Data values. Maximum 10.

IncludeMe optional

bool

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

GetPlayerDataForChilliConnectIdsResponse
Property Type Description
Values

IList of ChilliConnectPlayerDatas

An array of Keys and Values along with their associated ChilliConnectIDs.

Objects

ChilliConnectPlayerData
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

Key

string

The requested Custom Data Key.

Value

MultiTypeValue

The value of the Custom Data Key.

HasAttachment

bool

True if the Key has Attachment data associated with it.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

DateCreated

DateTime

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

DateTime

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

GetPlayerDataForChilliConnectIdsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data For Chilli Connect Ids

Returns the value of a specified Custom Data Key for a list of provided ChilliConnectIDs.

Request

ChilliConnect.CloudData.getPlayerDataForChilliConnectIds( Key ChilliConnectIDs IncludeMe )
Parameter Type Description
Key

String

The Custom Data Key to return.

ChilliConnectIDs

Array

A list of ChillIConnectIDs for which to retrieve Custom Data values. Maximum 10.

IncludeMe optional

Boolean

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

Attribute Type Description
Values

Array

An array of Keys and Values along with their associated ChilliConnectIDs.

  ChilliConnectID

String

The player's ChilliConnectID.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Get Player Data For Facebook Friends

Returns the value of a specified Custom Data Key for all of a players Facebook Friends.

/data/player/get/facebook

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Custom Data Key to return.

IncludeMe optional

Boolean

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Success 200

Field Type Description
Values

Array

An array of values containing the Cloud Data values for the requested players.

  ChilliConnectID

String

The player's ChilliConnectID.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookName

String

The player's Facebook name.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

2005

Player Not Linked To Facebook. The current player has no linked Facebook account.

2008

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

HTTP/1.1 200 OK
{
 "Values": [
   {
     "ChilliConnectID"   : "0ZbkBDYon9iBkgNnW19L9dLoE4v2dnL4",
     "Key"               : "LastChar",
     "Value"             : "testValue",
     "UserName"          : "UserOne",
     "DisplayName"       : "User",
     "FacebookName"      : "FacebookName",
     "DateCreated"       : "2015-11-10T14:08:11",
     "DateModified"      : "2015-11-11T09:58:12"
   },
   {
     "ChilliConnectID"   : "0ZbkBDasdadaw3r32nW19L9dLo234aAd",
     "Key"               : "testKey",
     "Value"             : "testValueOne"
     "UserName"          : "UserTwo",
     "DisplayName"       : "User",
     "FacebookName"      : "FacebookNameTwo",
     "DateCreated"       : "2015-10-10T17:04:21",
     "DateModified"      : "2015-11-04T13:49:01"
   }
 ]
}

Get Player Data For Facebook Friends

Returns the value of a specified Custom Data Key for all of a players Facebook Friends.

Request

CCGetPlayerDataForFacebookFriendsRequest
Property Type Description
Key

NSString

The Custom Data Key to return.

IncludeMe optional

BOOL

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

CCGetPlayerDataForFacebookFriendsResponse
Property Type Description
Values

NSArray of CCFacebookPlayerDatas

An array of values containing the Cloud Data values for the requested players.

Objects

CCFacebookPlayerData
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

Key

NSString

The requested Custom Data Key.

Value

SCMultiTypeValue

The value of the Custom Data Key.

HasAttachment

BOOL

True if the Key has Attachment data associated with it.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

FacebookName

NSString

The player's Facebook name.

DateCreated

NSDate

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

NSDate

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

CCGetPlayerDataForFacebookFriendsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data For Facebook Friends

Returns the value of a specified Custom Data Key for all of a players Facebook Friends.

Request

GetPlayerDataForFacebookFriendsRequest
Property Type Description
Key

string

The Custom Data Key to return.

IncludeMe optional

bool

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

GetPlayerDataForFacebookFriendsResponse
Property Type Description
Values

IList of FacebookPlayerDatas

An array of values containing the Cloud Data values for the requested players.

Objects

FacebookPlayerData
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

Key

string

The requested Custom Data Key.

Value

MultiTypeValue

The value of the Custom Data Key.

HasAttachment

bool

True if the Key has Attachment data associated with it.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

FacebookName

string

The player's Facebook name.

DateCreated

DateTime

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

DateModified

DateTime

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Errors

GetPlayerDataForFacebookFriendsError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data For Facebook Friends

Returns the value of a specified Custom Data Key for all of a players Facebook Friends.

Request

ChilliConnect.CloudData.getPlayerDataForFacebookFriends( Key IncludeMe )
Parameter Type Description
Key

String

The Custom Data Key to return.

IncludeMe optional

Boolean

If true, include the currently logged in player's Custom Data will also be included in the response. If not provided, this will be defaulted to false.

Response

Attribute Type Description
Values

Array

An array of values containing the Cloud Data values for the requested players.

  ChilliConnectID

String

The player's ChilliConnectID.

  Key

String

The requested Custom Data Key.

  Value

JSON

The value of the Custom Data Key.

  HasAttachment

Boolean

True if the Key has Attachment data associated with it.

  UserName

String

The player's UserName.

  DisplayName

String

The player's DisplayName.

  FacebookName

String

The player's Facebook name.

  DateCreated

String

The Date the Key was first created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  DateModified

String

The Date the Key was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

2005 PlayerNotLinkedToFacebook

Player Not Linked To Facebook. The current player has no linked Facebook account.

2008 UnableToGetFacebookFriends

Unable To Get Facebook Friends. The player's Facebook friends could not be retrieved. This may be because the Facebook AccessToken stoked against the player is no longer valid, there was a temporary error communicating with the Facebook API, or the AccessToken provided during Facebook Login did not have the player friends permission.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Delete Player Data

Deletes a specified Custom Data Key.

/data/player/delete

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Custom Data Key to delete.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be deleted with no checking.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

Error 409

Code Description
7001

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

{
  "Key"          : "PlayerRating"
  "WriteLock"    : "4"
}
HTTP/1.1 200 OK
{}

Delete Player Data

Deletes a specified Custom Data Key.

Request

CCDeletePlayerDataRequest
Property Type Description
Key

NSString

The Custom Data Key to delete.

WriteLock optional

NSString

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be deleted with no checking.

Errors

CCDeletePlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Delete Player Data

Deletes a specified Custom Data Key.

Request

DeletePlayerDataRequest
Property Type Description
Key

string

The Custom Data Key to delete.

WriteLock optional

string

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be deleted with no checking.

Errors

DeletePlayerDataError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Delete Player Data

Deletes a specified Custom Data Key.

Request

ChilliConnect.CloudData.deletePlayerData( Key WriteLock )
Parameter Type Description
Key

String

The Custom Data Key to delete.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a PlayerDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be deleted with no checking.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

6002 PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

7001 PlayerDataWriteConflict

Player Cloud Data Write Conflict. The the WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

Get Player Data Attachment

Returns the Attachment data for a specified identifier.

/data/player/attachment/get

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Custom Data Key to get the Attachment for.

Success 200

Field Type Description
Attachment

String

The attachment data requested.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

7003

Attachment Data Not Found.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Get Player Data Attachment

Returns the Attachment data for a specified identifier.

Request

CCGetPlayerDataAttachmentRequest
Property Type Description
Key

NSString

The Custom Data Key to get the Attachment for.

Response

CCGetPlayerDataAttachmentResponse
Property Type Description
Attachment

NSString

The attachment data requested.

Errors

CCGetPlayerDataAttachmentError
Name Description
AttachmentDataNotFound

Attachment Data Not Found.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data Attachment

Returns the Attachment data for a specified identifier.

Request

GetPlayerDataAttachmentRequest
Property Type Description
Key

string

The Custom Data Key to get the Attachment for.

Response

GetPlayerDataAttachmentResponse
Property Type Description
Attachment

string

The attachment data requested.

Errors

GetPlayerDataAttachmentError
Name Description
AttachmentDataNotFound

Attachment Data Not Found.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data Attachment

Returns the Attachment data for a specified identifier.

Available in the HTTP, iOS, Unity APIs.

Get Player Data Attachment For Chilli Connect Id

Returns the Attachment data for an identifier, or a specified Player.

/data/player/attachment/get/chilli

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
ChilliConnectID

String

ChillIConnectID for the player.

Key

String

The Custom Data Key to get the Attachment for.

Success 200

Field Type Description
Attachment

String

The attachment data requested.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

1009

Player Not Found. The player specified was not found.

7003

Attachment Data Not Found.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Get Player Data Attachment For Chilli Connect Id

Returns the Attachment data for an identifier, or a specified Player.

Request

CCGetPlayerDataAttachmentForChilliConnectIdRequest
Property Type Description
ChilliConnectID

NSString

ChillIConnectID for the player.

Key

NSString

The Custom Data Key to get the Attachment for.

Response

CCGetPlayerDataAttachmentForChilliConnectIdResponse
Property Type Description
Attachment

NSString

The attachment data requested.

Errors

CCGetPlayerDataAttachmentForChilliConnectIdError
Name Description
AttachmentDataNotFound

Attachment Data Not Found.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerNotFound

Player Not Found. The player specified was not found.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data Attachment For Chilli Connect Id

Returns the Attachment data for an identifier, or a specified Player.

Request

GetPlayerDataAttachmentForChilliConnectIdRequest
Property Type Description
ChilliConnectID

string

ChillIConnectID for the player.

Key

string

The Custom Data Key to get the Attachment for.

Response

GetPlayerDataAttachmentForChilliConnectIdResponse
Property Type Description
Attachment

string

The attachment data requested.

Errors

GetPlayerDataAttachmentForChilliConnectIdError
Name Description
AttachmentDataNotFound

Attachment Data Not Found.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerNotFound

Player Not Found. The player specified was not found.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Player Data Attachment For Chilli Connect Id

Returns the Attachment data for an identifier, or a specified Player.

Available in the HTTP, iOS, Unity APIs.

Get Collection Objects

Returns a list of Collection Objects identified by their ObjectID.

/data/collection/object/get

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Collection Key.

ObjectIDs

Array

The ObjectIDs for which to retrieve the objects of. Maximum 20.

Success 200

Field Type Description
Objects

Array

A list of objects.

Note: If an Object does not exist for a given ObjectID it will not be returned in the response. The rest of the Objects will be returned as normal.

  ObjectID

String

The ID of the Object.

  CreatedBy

Object

The Player that created the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  ModifiedBy

Object

The last Player that last modified the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateModified

String

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  Value

JSON

The Object's data.

  WriteLock

String

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

12002

Collection Not Found. The specified collection does not exist.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

12007

Collection Permission Denied. Player has insufficient permission to complete the request.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Get Collection Objects

Returns a list of Collection Objects identified by their ObjectID.

Request

CCGetCollectionObjectsRequest
Property Type Description
Key

NSString

The Collection Key.

ObjectIDs

NSArray of NSStrings

The ObjectIDs for which to retrieve the objects of. Maximum 20.

Response

CCGetCollectionObjectsResponse
Property Type Description
Objects

NSArray of CCCollectionDataObjects

A list of objects.

Note: If an Object does not exist for a given ObjectID it will not be returned in the response. The rest of the Objects will be returned as normal.

Objects

CCCollectionDataObject
Property Type Description
ObjectID

NSString

The ID of the Object.

CreatedBy

CCPlayer

The Player that created the Object.

DateCreated

NSDate

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

ModifiedBy

CCPlayer

The last Player that last modified the Object.

DateModified

NSDate

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Value

SCMultiTypeValue

The Object's data.

WriteLock

NSString

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

CCPlayer
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

Errors

CCGetCollectionObjectsError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Collection Objects

Returns a list of Collection Objects identified by their ObjectID.

Request

GetCollectionObjectsRequest
Property Type Description
Key

string

The Collection Key.

ObjectIDs

IList of strings

The ObjectIDs for which to retrieve the objects of. Maximum 20.

Response

GetCollectionObjectsResponse
Property Type Description
Objects

IList of CollectionDataObjects

A list of objects.

Note: If an Object does not exist for a given ObjectID it will not be returned in the response. The rest of the Objects will be returned as normal.

Objects

CollectionDataObject
Property Type Description
ObjectID

string

The ID of the Object.

CreatedBy

Player

The Player that created the Object.

DateCreated

DateTime

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

ModifiedBy

Player

The last Player that last modified the Object.

DateModified

DateTime

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Value

MultiTypeValue

The Object's data.

WriteLock

string

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Player
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

Errors

GetCollectionObjectsError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Collection Objects

Returns a list of Collection Objects identified by their ObjectID.

Request

ChilliConnect.CloudData.getCollectionObjects( Key ObjectIds )
Parameter Type Description
Key

String

The Collection Key.

ObjectIDs

Array

The ObjectIDs for which to retrieve the objects of. Maximum 20.

Response

Attribute Type Description
Objects

Array

A list of objects.

Note: If an Object does not exist for a given ObjectID it will not be returned in the response. The rest of the Objects will be returned as normal.

  ObjectID

String

The ID of the Object.

  CreatedBy

Object

The Player that created the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  ModifiedBy

Object

The last Player that last modified the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateModified

String

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  Value

JSON

The Object's data.

  WriteLock

String

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

12002 CollectionNotFound

Collection Not Found. The specified collection does not exist.

12007 CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

Add Collection Object

Adds an object to the specified collection.

/data/collection/object/add

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Collection Key.

Value

JSON

The data to be saved. When serialised the maximum size is 400kb.

Success 200

Field Type Description
ObjectID

String

Identifier for the created Collection object.

WriteLock

String

The current value of the WriteLock for this Object. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent attempts.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

12002

Collection Not Found. The specified collection does not exist.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

12007

Collection Permission Denied. Player has insufficient permission to complete the request.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

12005

Collection Field Invalid. Object contains a field that is invalid.

12006

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Add Collection Object

Adds an object to the specified collection.

Request

CCAddCollectionObjectRequest
Property Type Description
Key

NSString

The Collection Key.

Value

SCMultiTypeValue

The data to be saved. When serialised the maximum size is 400kb.

Response

CCAddCollectionObjectResponse
Property Type Description
ObjectID

NSString

Identifier for the created Collection object.

WriteLock optional

NSString

The current value of the WriteLock for this Object. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent attempts.

Errors

CCAddCollectionObjectError
Name Description
CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Add Collection Object

Adds an object to the specified collection.

Request

AddCollectionObjectRequest
Property Type Description
Key

string

The Collection Key.

Value

MultiTypeValue

The data to be saved. When serialised the maximum size is 400kb.

Response

AddCollectionObjectResponse
Property Type Description
ObjectID

string

Identifier for the created Collection object.

WriteLock optional

string

The current value of the WriteLock for this Object. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent attempts.

Errors

AddCollectionObjectError
Name Description
CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Add Collection Object

Adds an object to the specified collection.

Request

ChilliConnect.CloudData.addCollectionObject( Key Value )
Parameter Type Description
Key

String

The Collection Key.

Value

JSON

The data to be saved. When serialised the maximum size is 400kb.

Response

Attribute Type Description
ObjectID

String

Identifier for the created Collection object.

WriteLock

String

The current value of the WriteLock for this Object. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent attempts.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

12002 CollectionNotFound

Collection Not Found. The specified collection does not exist.

12005 CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

12006 CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

12007 CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

Update Collection Object

Updates an object in the specified collection.

/data/collection/object/update

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Collection Key.

ObjectID

String

Identifier for the Collection object to be updated.

Value

JSON

The data to be saved. When serialised the maximum size is 400kb.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Success 200

Field Type Description
ObjectID

String

Identifier for the updated Collection object.

WriteLock

String

The updated value of the WriteLock for this Object.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

12002

Collection Not Found. The specified collection does not exist.

12003

Collection Object Not Found. The specified collection object does not exist.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

12007

Collection Permission Denied. Player has insufficient permission to complete the request.

Error 409

Code Description
12008

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

12005

Collection Field Invalid. Object contains a field that is invalid.

12006

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Update Collection Object

Updates an object in the specified collection.

Request

CCUpdateCollectionObjectRequest
Property Type Description
Key

NSString

The Collection Key.

ObjectID

NSString

Identifier for the Collection object to be updated.

Value

SCMultiTypeValue

The data to be saved. When serialised the maximum size is 400kb.

WriteLock optional

NSString

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Response

CCUpdateCollectionObjectResponse
Property Type Description
ObjectID

NSString

Identifier for the updated Collection object.

WriteLock optional

NSString

The updated value of the WriteLock for this Object.

Errors

CCUpdateCollectionObjectError
Name Description
CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Update Collection Object

Updates an object in the specified collection.

Request

UpdateCollectionObjectRequest
Property Type Description
Key

string

The Collection Key.

ObjectID

string

Identifier for the Collection object to be updated.

Value

MultiTypeValue

The data to be saved. When serialised the maximum size is 400kb.

WriteLock optional

string

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Response

UpdateCollectionObjectResponse
Property Type Description
ObjectID

string

Identifier for the updated Collection object.

WriteLock optional

string

The updated value of the WriteLock for this Object.

Errors

UpdateCollectionObjectError
Name Description
CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Update Collection Object

Updates an object in the specified collection.

Request

ChilliConnect.CloudData.updateCollectionObject( Key ObjectId Value WriteLock )
Parameter Type Description
Key

String

The Collection Key.

ObjectID

String

Identifier for the Collection object to be updated.

Value

JSON

The data to be saved. When serialised the maximum size is 400kb.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Response

Attribute Type Description
ObjectID

String

Identifier for the updated Collection object.

WriteLock

String

The updated value of the WriteLock for this Object.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

12002 CollectionNotFound

Collection Not Found. The specified collection does not exist.

12003 CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

12005 CollectionFieldInvalid

Collection Field Invalid. Object contains a field that is invalid.

12006 CollectionObjectInvalid

Collection Object Invalid. The Collection Object does not conform to the Collection Field definition.

12007 CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

12008 CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Delete Collection Object

Deletes an object in the specified collection.

/data/collection/object/delete

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Collection Key.

ObjectID

String

Identifier for the Collection object to be deleted.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

12002

Collection Not Found. The specified collection does not exist.

12003

Collection Object Not Found. The specified collection object does not exist.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

12007

Collection Permission Denied. Player has insufficient permission to complete the request.

Error 409

Code Description
12008

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Delete Collection Object

Deletes an object in the specified collection.

Request

CCDeleteCollectionObjectRequest
Property Type Description
Key

NSString

The Collection Key.

ObjectID

NSString

Identifier for the Collection object to be deleted.

WriteLock optional

NSString

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Errors

CCDeleteCollectionObjectError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Delete Collection Object

Deletes an object in the specified collection.

Request

DeleteCollectionObjectRequest
Property Type Description
Key

string

The Collection Key.

ObjectID

string

Identifier for the Collection object to be deleted.

WriteLock optional

string

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Errors

DeleteCollectionObjectError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Delete Collection Object

Deletes an object in the specified collection.

Request

ChilliConnect.CloudData.deleteCollectionObject( Key ObjectId WriteLock )
Parameter Type Description
Key

String

The Collection Key.

ObjectID

String

Identifier for the Collection object to be deleted.

WriteLock optional

String

To enable conflict checking provide the previous WriteLock value. If this value does not match the data store a CollectionDataWriteConflict will be issued. If you don't wish to use conflict checking don't provide this parameter - data will be written with no checking.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

12002 CollectionNotFound

Collection Not Found. The specified collection does not exist.

12003 CollectionObjectNotFound

Collection Object Not Found. The specified collection object does not exist.

12007 CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

12008 CollectionObjectWriteConflict

Collection Object Write Conflict. The WriteLock parameter is out of date. There have been writes since the previous WriteLock given in the request. Details of the Attempted and Existing data will be available in the response data attribute.

Query Collection

Returns objects that satisfy the query for a specified collection.

/data/collection/query

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Key

String

The Collection Key.

Query optional

String

A query to define which Objects to return. If not given all Objects in a Collection will be returned. See the Querying a Collection guide.

Params optional

Object

Key/value pairs that substitute placeholders in the query. E.g. {"name": "Geoff"} for query "Value.Name = :name". See the Querying a Collection guide.

SortFields optional

Array

An ordered list that define the response sort order. If not given Objects will be ordered by DateCreated ascending.

  Field

String

The Field to sort on. E.g. Value.Name.

Note: it is not possible to sort on String Full Text fields.

  Order

String

Ascending (Asc) or Descending (Desc) order.

Page optional

Integer

Results are paged. Maximum 100.

Success 200

Field Type Description
Objects

Array

A list of objects that satisfy the query.

  ObjectID

String

The ID of the Object.

  CreatedBy

Object

The Player that created the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  ModifiedBy

Object

The last Player that last modified the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateModified

String

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  Value

JSON

The Object's data.

  WriteLock

String

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Total

Integer

The total number of objects that match the query.

Page

Integer

The current page.

PageSize

Integer

The number of results returned per page.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

12002

Collection Not Found. The specified collection does not exist.

Error 403

Code Description
1011

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

12007

Collection Permission Denied. Player has insufficient permission to complete the request.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

12004

Query Syntax Invalid. The query you have provided has incorrect syntax.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Examples

{
    "Key": "RIVALS",
    "Query": "Value.Class = :vclass AND Value.Experience > :vexperience",
    "Params": {
        "vclass": "Seieibushi",
        "vexperience": 72
    },
    "SortFields": [
        {
            "Field": "Value.Experience",
            "Order": "Asc"
        }
    ]
}
{
    "Key": "RIVALS",
    "Query": "Value.Class = :vclass1 OR Value.Class = :vclass2"
    "Params": {
        "vclass1": "Seieibushi",
        "vclass2": "Kodenbushi"
    },
    "SortFields": [
        {
            "Field": "Value.Experience",
            "Order": "Asc"
        }
    ]
}
{
    "Key": "RIVALS",
    "Query": "( Value.Class = :vclass1 AND Value.Experience > :vexperience1 ) OR ( Value.Class = :vclass2 AND Value.Experience > :vexperience2 )",
    "Params": {
        "vclass1": "Seieibushi",
        "vexperience1": 72,
        "vclass2": "Kodenbushi",
        "vexperience2": 87,
    },
    "SortFields": [
        {
            "Field": "Value.Experience",
            "Order": "Asc"
        }
    ]
}
HTTP/1.1 200 OK
{
    "Total": 1,
    "Page": 1,
    "PageSize": 20,
    "Objects": [
        {
            "ObjectID": "c8d0a4c6-b408-11e6-8d56-0400271d6f11",
            "CreatedBy": {
                "ChilliConnectID": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "UserName": null,
                "DisplayName": "Tokugawa"
            },
            "DateCreated": "2016-11-30T14:25:03",
            "ModifiedBy": {
                "ChilliConnectID": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "UserName": null,
                "DisplayName": "Tokugawa"
            },
            "DateModified": "2016-11-30T15:38:08",
            "Value": {
                "Identifier": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "Name": "Tokugawa",
                "Class": "Seieibushi",
                "Experience": 74,
                "History": {
                    "Wins": 14,
                    "Losses": 2
                }
            },
            "WriteLock": "4"
        }
    ]
}

Query Collection

Returns objects that satisfy the query for a specified collection.

Request

CCQueryCollectionRequest
Property Type Description
Key

NSString

The Collection Key.

Query optional

NSString

A query to define which Objects to return. If not given all Objects in a Collection will be returned. See the Querying a Collection guide.

Params optional

NSDictionary of NSString to SCMultiTypeValue

Key/value pairs that substitute placeholders in the query. E.g. {"name": "Geoff"} for query "Value.Name = :name". See the Querying a Collection guide.

SortFields optional

NSArray of CCSortFields

An ordered list that define the response sort order. If not given Objects will be ordered by DateCreated ascending.

Page optional

int32_t

Results are paged. Maximum 100.

Response

CCQueryCollectionResponse
Property Type Description
Objects

NSArray of CCCollectionDataObjects

A list of objects that satisfy the query.

Total

int32_t

The total number of objects that match the query.

Page

int32_t

The current page.

PageSize

int32_t

The number of results returned per page.

Objects

CCSortField
Property Type Description
Field

NSString

The Field to sort on. E.g. Value.Name.

Note: it is not possible to sort on String Full Text fields.

Order

NSString

Ascending (Asc) or Descending (Desc) order.

CCCollectionDataObject
Property Type Description
ObjectID

NSString

The ID of the Object.

CreatedBy

CCPlayer

The Player that created the Object.

DateCreated

NSDate

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

ModifiedBy

CCPlayer

The last Player that last modified the Object.

DateModified

NSDate

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Value

SCMultiTypeValue

The Object's data.

WriteLock

NSString

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

CCPlayer
Property Type Description
ChilliConnectID

NSString

The player's ChilliConnectID.

UserName

NSString

The player's UserName.

DisplayName

NSString

The player's DisplayName.

Errors

CCQueryCollectionError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

CollectionQueryInvalid

Query Syntax Invalid. The query you have provided has incorrect syntax.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Query Collection

Returns objects that satisfy the query for a specified collection.

Request

QueryCollectionRequest
Property Type Description
Key

string

The Collection Key.

Query optional

string

A query to define which Objects to return. If not given all Objects in a Collection will be returned. See the Querying a Collection guide.

Params optional

IDictionary of string to MultiTypeValue

Key/value pairs that substitute placeholders in the query. E.g. {"name": "Geoff"} for query "Value.Name = :name". See the Querying a Collection guide.

SortFields optional

IList of SortFields

An ordered list that define the response sort order. If not given Objects will be ordered by DateCreated ascending.

Page optional

int

Results are paged. Maximum 100.

Response

QueryCollectionResponse
Property Type Description
Objects

IList of CollectionDataObjects

A list of objects that satisfy the query.

Total

int

The total number of objects that match the query.

Page

int

The current page.

PageSize

int

The number of results returned per page.

Objects

SortField
Property Type Description
Field

string

The Field to sort on. E.g. Value.Name.

Note: it is not possible to sort on String Full Text fields.

Order

string

Ascending (Asc) or Descending (Desc) order.

CollectionDataObject
Property Type Description
ObjectID

string

The ID of the Object.

CreatedBy

Player

The Player that created the Object.

DateCreated

DateTime

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

ModifiedBy

Player

The last Player that last modified the Object.

DateModified

DateTime

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

Value

MultiTypeValue

The Object's data.

WriteLock

string

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Player
Property Type Description
ChilliConnectID

string

The player's ChilliConnectID.

UserName

string

The player's UserName.

DisplayName

string

The player's DisplayName.

Errors

QueryCollectionError
Name Description
CollectionNotFound

Collection Not Found. The specified collection does not exist.

CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

CollectionQueryInvalid

Query Syntax Invalid. The query you have provided has incorrect syntax.

ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

MethodDisabled

Method Disabled. Public access to this method has been disabled on the ChilliConnect Dashboard.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Query Collection

Returns objects that satisfy the query for a specified collection.

Request

ChilliConnect.CloudData.queryCollection( Key Query Params SortFields Page )
Parameter Type Description
Key

String

The Collection Key.

Query optional

String

A query to define which Objects to return. If not given all Objects in a Collection will be returned. See the Querying a Collection guide.

Params optional

Object

Key/value pairs that substitute placeholders in the query. E.g. {"name": "Geoff"} for query "Value.Name = :name". See the Querying a Collection guide.

SortFields optional

Array

An ordered list that define the response sort order. If not given Objects will be ordered by DateCreated ascending.

  Field

String

The Field to sort on. E.g. Value.Name.

Note: it is not possible to sort on String Full Text fields.

  Order

String

Ascending (Asc) or Descending (Desc) order.

Page optional

Number

Results are paged. Maximum 100.

Response

Attribute Type Description
Objects

Array

A list of objects that satisfy the query.

  ObjectID

String

The ID of the Object.

  CreatedBy

Object

The Player that created the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateCreated

String

The Date the Object was created. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  ModifiedBy

Object

The last Player that last modified the Object.

    ChilliConnectID

String

The player's ChilliConnectID.

    UserName

String

The player's UserName.

    DisplayName

String

The player's DisplayName.

  DateModified

String

The Date the Object was last updated. Format: ISO8601 e.g. 2016-01-12T11:08:23.

  Value

JSON

The Object's data.

  WriteLock

String

The current value of the WriteLock. To enable conflict checking, the returned WriteLock can be provided to the update and delete calls on subsequent update attempts.

Total

Number

The total number of objects that match the query.

Page

Number

The current page.

PageSize

Number

The number of results returned per page.

Exceptions

Code Name Description
1007 InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

1008 TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

10002 RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

12002 CollectionNotFound

Collection Not Found. The specified collection does not exist.

12004 CollectionQueryInvalid

Query Syntax Invalid. The query you have provided has incorrect syntax.

12007 CollectionPermissionDenied

Collection Permission Denied. Player has insufficient permission to complete the request.

Examples

var query = "Value.Class = :vclass AND Value.Experience > :vexperience";
var params = {
    "vclass": "Seieibushi",
    "vexperience": 72
};
var sortFields = [
    {
        "Field": "Value.Experience",
        "Order": "Asc"
    }
];

var response = ChilliConnect.CloudData.queryCollection("RIVALS", query, params, sortFields, 1);
var query = "Value.Class = :vclass1 OR Value.Class = :vclass2";
var params = {
    "vclass1": "Seieibushi",
    "vclass2": "Kodenbushi"
};
var sortFields = [
    {
        "Field": "Value.Experience",
        "Order": "Asc"
    }
];

var response = ChilliConnect.CloudData.queryCollection("RIVALS", query, params, sortFields, 1);
var query = "( Value.Class = :vclass1 AND Value.Experience > :vexperience1 ) OR ( Value.Class = :vclass2 AND Value.Experience > :vexperience2 )";
var params = {
    "vclass1": "Seieibushi",
    "vexperience1": 72,
    "vclass2": "Kodenbushi",
    "vexperience2": 87,
};
var sortFields = [
    {
        "Field": "Value.Experience",
        "Order": "Asc"
    }
];

var response = ChilliConnect.CloudData.queryCollection("RIVALS", query, params, sortFields, 1);
{
    "Total": 1,
    "Page": 1,
    "PageSize": 20,
    "Objects": [
        {
            "ObjectID": "c8d0a4c6-b408-11e6-8d56-0400271d6f11",
            "CreatedBy": {
                "ChilliConnectID": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "UserName": null,
                "DisplayName": "Tokugawa"
            },
            "DateCreated": "2016-11-30T14:25:03",
            "ModifiedBy": {
                "ChilliConnectID": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "UserName": null,
                "DisplayName": "Tokugawa"
            },
            "DateModified": "2016-11-30T15:38:08",
            "Value": {
                "Identifier": "3gGZ8GpWMprH5YTitrbHK5T0kHcw7Que",
                "Name": "Tokugawa",
                "Class": "Seieibushi",
                "Experience": 74,
                "History": {
                    "Wins": 14,
                    "Losses": 2
                }
            },
            "WriteLock": "4"
        }
    ]
}

Economy

The ChillConnect Economy Management module. Provides the means to retrieve and modify player currencies and inventory.

Get Currency Balance

Returns a list of currency balances for the currently logged in player.

/economy/currency/balance/get

Header

Field Type Description
Connect-Access-Token

String

A valid session ConnectAccessToken obtained through one of the login endpoints.

Parameter

Field Type Description
Keys optional

Array

An array list of currency Keys to return balances for. If empty balances for all currencies in the economy will be returned.

Success 200

Field Type Description
Balances

Array

An array of Currency balances.

  Name

String

The currency name.

  Key

String

The currency key.

  Balance

Integer

The player's balance.

  WriteLock

String

The current value of the WriteLock for this Currency Key. To enable conflict checking, the returned WriteLock can be provided to the Set Currency Balance, Withdraw Currency, Deposit Currency and Convert Currency calls on subsequent update attempts.

Error 401

Code Description
1003

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

1004

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

6002

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

Error 422

Code Description
1007

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

Error 429

Code Description
10002

Rate Limit Reached. Too many requests. Player has been rate limited.

Error 500

Code Description
1

Unexpected Error. An unexpected, fatal error has occurred.

Error 503

Code Description
1008

Temporary Service Error. A temporary error is preventing the request from being processed.

Get Currency Balance

Returns a list of currency balances for the currently logged in player.

Request

CCGetCurrencyBalanceRequest
Property Type Description
Keys optional

NSArray of NSStrings

An array list of currency Keys to return balances for. If empty balances for all currencies in the economy will be returned.

Response

CCGetCurrencyBalanceResponse
Property Type Description
Balances

NSArray of CCCurrencyBalances

An array of Currency balances.

Objects

CCCurrencyBalance
Property Type Description
Name

NSString

The currency name.

Key

NSString

The currency key.

Balance

int32_t

The player's balance.

WriteLock

NSString

The current value of the WriteLock for this Currency Key. To enable conflict checking, the returned WriteLock can be provided to the Set Currency Balance, Withdraw Currency, Deposit Currency and Convert Currency calls on subsequent update attempts.

Errors

CCGetCurrencyBalanceError
Name Description
ExpiredConnectAccessToken

Expired Connect Access Token. The Connect-Access-Token used to authenticate with the server has expired and should be renewed.

InvalidConnectAccessToken

Invalid Connect Access Token. The Connect-Access-Token was not valid and cannot be used to authenticate requests.

InvalidRequest

Invalid Request. One of more of the provided fields were not correctly formatted. The data property of the response body will contain specific error messages for each field.

PlayerContextNotSet

Player Context Not Set. Only applicable to Cloud Code Scripts. Attempted to call a method that required a player context, but none was set. Note that the AsPlayer method can be used to set a specific player context.

RateLimitReached

Rate Limit Reached. Too many requests. Player has been rate limited.

TemporaryServiceError

Temporary Service Error. A temporary error is preventing the request from being processed.

Unexpected

Unexpected Error. An unexpected, fatal error has occurred.

Get Currency Balance

Returns a list of curr