Introduction
The Data Export functionality in GameSparks allows you to export your game data from the NoSQL collections and Game Data Service. Using the GameSparks REST API you can generate a presigned URL (valid for 24 hours) to download the following data:
- NoSQL Collections: Leaderboards, Running Totals, System, Runtime (except script.log) and Metadata.
- Game Data Service: All data.
Due to sensitivity of the data, the following fields are not included in the NoSQL export:
- Player passwords
- Authorization tokens
- Location data
The NoSQL REST APIs can be used to retrieve the fields not included in the Data Export.
View the GameSparks REST API Overview for more information on using the GameSparks REST APIs.
We've designed our services to avoid the need for you to share or store personally identifiable information of your players on our services. However, if you've made certain choices - such as integrating with social networks or asking your players for personal data - then the Data Export will include such personal data that you've chosen to store on the service. You are responsible for employing appropriate safeguards and for complying with privacy law applicable to you. Additionally, by accessing your data through the Data Export, you may choose to transfer your game's data outside the region the game is deployed to; if you do so, you are responsible for compliance with any applicable data export regulations. For more information on managing player data, view the Player Data Management Guide.
There are two methods in place to generate a presigned URL to retrieve your games data. Both use the GameSparks REST API.
- Method 1 covers presigned URL generation using the GameSparks REST API documentation page. This method only requires your GameSparks username/password and target games apikey.
- Method 2 covers presigned URL generation using the GameSparks REST API directly.
Method 1 example
To generate a presigned URL for GDS please visit this page and follow these steps.
- Enter your GameSparks username/password and
- Enter target games apiKey.
- Set the stage to live.
- Click
Try!
- Enter the apiKey in the request paramters.
- Click
Try it out!
- Your GDS data is ready to download. The presigned URL can be found in the response.
To generate a presigned URL for MongoDB please visit this page and follow these steps. Enter your GameSparks username/password and
- Enter target games apiKey.
- Set the stage to live.
- Click
Try!
- Enter the apiKey in the request paramters.
- Click
Try it out!
- Your MongoDB data is ready to download. The presigned URL can be found in the response.
Method 2 example
Authentication
The Data Export REST API uses the GameSparks JSON web token authentication type. For further details, see the GameSparks JSON WEB Token section on the REST APIs Overview page. Accounts must have "Data Explorer" permissions to call the Data Export API.
Discovering the Endpoint
The Data Export APIs make use of the previewNosql and liveNosql endpoints which can be discovered using the following API request:
GET https://config2.gamesparks.net/restv2/game/{gameApiKey}/endpoints
See NoSQL REST API for more information on discovering API endpoints.
NoSQL Data Export
GET {endpoint}/restv2/game/{gameApiKey}/mongo/export
Data Service Export
GET {endpoint}/restv2/game/{gameApiKey}/data/export
Code Examples
Here are some examples using curl to interact with the Data Export APIs.
Generating a JSON web token
curl -X GET --header 'Accept: application/json' --header 'Authorization: Basic xxxxxxxx' 'https://auth.gamesparks.net/restv2/auth/game/{gameApiKey}/jwt?expireInSeconds=300'
Generating a presigned URL for NoSQL
curl -X GET --header 'Accept: application/json' --header 'X-GS-JWT: {JsonWebToken}' 'https://{gameApiKey}.live.cluster.gamesparks.net/restv2/game/{gameApiKey}/mongo/export'
Generating a presigned URL for Data Service
curl -X GET --header 'Accept: application/json' --header 'X-GS-JWT: {JsonWebToken}' 'https://{gameApiKey}.live.cluster.gamesparks.net/restv2/game/{gameApiKey}/data/export'
Additional Information
- The exported data is in JSON format and is intended to be parsed by standard JSON tools.
- Only live game data will be exported currently.
- You may see the same document id in the same Data Type in your GDS export. GDS stores multiple versions of documents which are included in the export.
- Empty strings "" in GDS are stored as
"__GS_PLACEHOLDER_*'鰳#\u0000!俄`�^é_\"
- Data exported via this API may not be up to date at the time of request.