↕️REST API
Last updated
Last updated
If you use an engine other than Unity, Cordova, or HTML5, you can access our service through a REST API. Send data as JSON (not form data) when testing.
POST
https://api.galaxysdk.com/api/v1/signup/anonymous
Get an anonymous token for this user. You'll need this to make subsequent calls
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Player ID: Get the player ID from the token by decoding the base64 string and extracting the value under the user_id
key.
POST
https://api.galaxysdk.com/api/v1/client/leaderboards/:leaderboard_id/report_score
Submit a score from the client.
Name | Type | Description |
---|---|---|
POST
https://api.galaxysdk.com/api/v1/server/report_scores
Submit a score from the server. Update a player's scores on leaderboards. Each index in the scores array corresponds to the index in the leaderboard array. For example,
leaderboard_ids: ["mygame.coins", "mygame.totalscore"]
scores: [155, 2940]
would update this player's best score to 155 on the coins leaderboard and 2940 on the totalscore leaderboard.
GET
https://api.galaxysdk.com/api/v1/client/leaderboards/:leaderboard_id/players/:player_id
Submit a score from the server. Update a player's scores on leaderboards. Each index in the scores array corresponds to the index in the leaderboard array. For example,
leaderboard_ids: ["mygame.coins", "mygame.totalscore"]
scores: [155, 2940]
would update this player's best score to 155 on the coins leaderboard and 2940 on the totalscore leaderboard.
See Data Types for obejct descriptions
Show the leaderboard
Open this URL in a webview or in app browser:
https://app.galaxy.us/leaderboards/:leaderboard_id?token=<token>&hideCloseButton=true
Change hideCloseButton
to false if you want to use the close button in the UI. However, you need to listen for URLs with query string sdk_action=close_window
and close the webview.
Show the avatar
Get the avatar image from this URL:
https://api.galaxysdk.com/api/v1/users/{galaxy player id}/avatar.png
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Publishable-Key
String
The game's publishable key
device_id
String
Unique identifier for this device
leaderboard_id*
String
Path parameter of the leaderboard ID you want to get
Publishable-Key*
String
The game's publishable key
Anonymous-Authorization*
String
An anonymous user's token
score*
Number
The score
Secret-Key*
String
Your server API Key
player_id*
String
Galaxy Player ID
scores*
[Double]
Array of corresponding scores for each leaderboard ID
leaderboard_ids*
[String]
Array of leaderboard IDs to update
Secret-Key*
String
Your server API Key
player_id*
String
Galaxy Player ID
scores*
[Double]
Array of corresponding scores for each leaderboard ID
leaderboard_ids*
[String]
Array of leaderboard IDs to update