文档

​
​

Development

User Acquisition

Monetization

工业

Cloud Save API

v1

受支持
​

Cloud Save API

v1

受支持
​

此页面不支持所选语言。
Unity Services Web APIs
​
​
Cloud Save API
  • Introduction
  • General Information
mdx:openapi:endpoints
  • Data
  • Files

Cloud Save API

Introduction

This is the API specification for the Unity Cloud Save service that allows player or custom non-player state to be accessed and persisted from a game client. The Player State API allows data to be stored against a specific player ID. Access using client authentication is limited to the specified player for both data reads and writes. The Game State API allows data to be stored against a custom ID provided by the user. All players are able to read the data from the custom ID using client authentication, but write operations are limited to Service Account authentication. To use this API, you must first enable it through the Unity Gaming Services dashboard.

General Information

Cloud Save Data is for storing small blobs of JSON serializable data, stored as key/value pairs. It can store data against a player ID (referred to as Player State) or a custom ID (referred to as Game State). The custom ID is a string that can be used to store data against a non-player entity, but the client API is restricted to read-only access. In addition to the default access levels for player and game state, data can be stored in public player state, protected player state, or private game state. The access details are as follows:
  • Default Player State: Player-writable and player-readable, by the player the data corresponds to
  • Public Player State: Player-writable by the player the data corresponds to, and readable by any player (e.g. public player profile data)
  • Protected Player State: Server-writable only, and player-readable by the player the data corresponds to
  • Default Game State: Server-writable only, player-readable by any player
  • Private Game State: Server-writable and server-readable only
The maximum size for player or custom data is 5 MB across all key/value pairs for that player and access class. A player can have data in a single slot that is up to 5 MB in size, or use many slots that equal to less than 5 MB in total size. Limits:
  • Maximum 255 characters per slot name
  • Maximum 2000 data slots per player or custom ID per access class
  • Maximum 5 MB in size per player or custom ID per access class across all slots
Cloud Save Files is for storing data files (binary, JSON, text, CSV, etc.) against keys. The maximum size for player data is 1 GB across all keys for that player. A player can have data in a single file that is up to 1 GB in size, or use many files that equal to less than 1 GB in total size. Limits:
  • Maximum 255 characters per file name
  • Maximum 200 files per player
  • Maximum 1 GB in size per player across all files

Rate Limits

The API has rate limiting in place. The endpoints are limited to 600 requests per minute on a per-player basis. The API responds with a
429
HTTP status code if the rate limit is exceeded. It will also respond with a
Retry-After
header to be used in conjunction with a client's retry logic. The value is the number of seconds until a request for the given player will be accepted.
Download OpenAPI specification:

Get Players


Retrieves a paginated list of all players which have data set, ordered alphabetically by player ID, with metadata about their stored data.
Authorizations
ServiceAccount (cloud_save.entities.list)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.entities.list

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Query parameters for "{title}"

start

The player ID to start the page from. If not specified, the first page will be returned.

limit

integer
The maximum number of player data IDs to return. If not specified, the default limit of 20 will be used.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "accessClasses": { "default": { "totalSize": 0, "numKeys": 0 }, "public": { "totalSize": 0, "numKeys": 0 }, "protected": { "totalSize": 0, "numKeys": 0 }, "private": { "totalSize": 0, "numKeys": 0 } } } ], "links": { "next": "string" }}

Set Player Item Batch Across Access Classes


Set up to 100 data items with key, value and optional writeLock for the given player, across multiple access classes. The values are limited to a maximum size of 5 MB per access level slots for the player. Saved state for each access level for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic per access class, but may succeed on one access class and fail on another. Error responses should identify the affected key operations that failed.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

default

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

public

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

protected

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

private

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "default": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }, "public": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }, "protected": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }, "private": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/all/item-batch"

Response example

{ "results": { "default": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] }, "public": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] }, "protected": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] }, "private": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] } }}

Get Player Items Across Access Classes


Retrieves saved data values for all keys specified, across access classes. Limited to a maximum of 100 keys across all access classes.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

default

object
No description

keys

array[string]
List of keys

public

object
No description

keys

array[string]
List of keys

protected

object
No description

keys

array[string]
List of keys

private

object
No description

keys

array[string]
List of keys

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "default": { "keys": [ "EXAMPLE_KEY" ] }, "public": { "keys": [ "EXAMPLE_KEY" ] }, "protected": { "keys": [ "EXAMPLE_KEY" ] }, "private": { "keys": [ "EXAMPLE_KEY" ] }}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/all/item-request"

Response example

{ "results": { "default": { "data": [] }, "public": { "data": [] }, "protected": { "data": [] }, "private": { "data": [] } }}

Set Player Item


Set a data item with a given key and value for the specified player. The value is limited to a maximum size of 5 MB across all default access level slots. The entire default access level saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Player Items


Retrieves saved data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Player Items


Deletes all default access level data associated with a given player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Player Item


Deletes a data item by the specified key for the given player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Player Keys


Gets a paged list of keys for the given player, ordered alphabetically in pages of 100.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Player Item Batch


Set up to 20 data items with key, value and optional writeLock for the given player. The values are limited to a maximum size of 5 MB across all default access level slots for the player. The entire default access level saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Default Player Data


Query player data with the default access class. If no index is available to fulfil the query then the query will fail.
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

Set Public Player Item


Set a public data item with a given key and value for the specified player. The value is limited to a maximum size of 5 MB across all public access level slots. The entire public saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The value set will be publicly readable by any player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Public Player Items


Retrieves saved data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20. Accessible by any player for any other player's data.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Public Player Items


Deletes all public data associated with a given player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Public Player Item


Deletes a public data item by the specified key for the given player.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Public Player Keys


Gets a paged list of public keys for the given player, ordered alphabetically in pages of 100. Accessible by any player for any other player's data.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Public Player Item Batch


Set up to 20 public data items with key, value and optional writeLock for the given player. The values are limited to a maximum size of 5 MB across all slots for the player. The entire public saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/public/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Public Player Data


Query player data with the public access class. If no index is available to fulfil the query then the query will fail.
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/public/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

Set Protected Player Item


Set a protected data item with a given key and value for the specified player. The value is limited to a maximum size of 5 MB across all protected access level slots. The entire protected saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Protected Player Items


Retrieves protected save data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Protected Player Items


Deletes all protected data associated with a given player. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Protected Player Item


Deletes a protected data item by the specified key for the given player. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Protected Player Keys


Gets a paged list of protected keys for the given player, ordered alphabetically in pages of 100.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Protected Player Item Batch


Set up to 20 protected data items with key, value and optional writeLock for the given player. The values are limited to a maximum size of 5 MB across all slots for the player. The entire protected saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/protected/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Protected Player Data


Query player data with the protected access class. If no index is available to fulfil the query then the query will fail.
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/protected/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

Set Private Player Item


Set a private data item with a given key and value for the specified player. The value is limited to a maximum size of 5 MB across all private access level slots. The entire private saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Private Player Items


Retrieves private save data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Private Player Items


Deletes all private data associated with a given player. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Private Player Item


Deletes a private data item by the specified key for the given player. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock. Only accessible via an authenticated server authority.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Private Player Keys


Gets a paged list of private keys for the given player, ordered alphabetically in pages of 100. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Private Player Item Batch


Set up to 20 private data items with key, value and optional writeLock for the given player. The values are limited to a maximum size of 5 MB across all slots for the player. The entire private saved state for a player is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/{playerId}/private/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Private Player Data


Query player data with the private access class. If no index is available to fulfil the query then the query will fail. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/players/private/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

Get Custom IDs


Get a paginated list of all Game State custom data IDs for a given project and environment.
Authorizations
ServiceAccount (cloud_save.entities.list)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.entities.list

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Query parameters for "{title}"

start

The custom data ID to start the page from. If not specified, the first page will be returned.

limit

integer
The maximum number of custom data IDs to return. If not specified, the default limit of 20 will be used.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom"

Response example

{ "results": [ { "id": "my-custom-data-id", "accessClasses": { "default": { "totalSize": 0, "numKeys": 0 }, "public": { "totalSize": 0, "numKeys": 0 }, "protected": { "totalSize": 0, "numKeys": 0 }, "private": { "totalSize": 0, "numKeys": 0 } } } ], "links": { "next": "string" }}

Set Custom Item Batch Across Access Classes


Set up to 100 data items with key, value and optional writeLock for the given custom ID, across multiple access classes. The values are limited to a maximum size of 5 MB per access level slots for the custom ID. Saved state for each access level for a custom ID is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic per access class, but may succeed on one access class and fail on another. Error responses should identify the affected key operations that failed.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

default

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

private

object
No description

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "default": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }, "private": { "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ] }}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/all/item-batch"

Response example

{ "results": { "default": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] }, "private": { "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ] } }}

Get Custom Items Across Access Classes


Retrieves saved data values for all keys specified, across access classes. Limited to a maximum of 100 keys across all access classes.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

default

object
No description

keys

array[string]
List of keys

private

object
No description

keys

array[string]
List of keys

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "default": { "keys": [ "EXAMPLE_KEY" ] }, "private": { "keys": [ "EXAMPLE_KEY" ] }}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/all/item-request"

Response example

{ "results": { "default": { "data": [] }, "private": { "data": [] } }}

Set Custom Item


Set a data item with a given key and value for the specified custom ID. The value is limited to a maximum size of 5 MB across all default access level slots. The entire default access level saved state for a custom ID is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Custom Items


Retrieves saved data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Custom Items


Deletes all default access level data associated with a given custom ID. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Custom Item


Deletes a data item by the specified key for the specified custom ID. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Custom Keys


Gets a paged list of keys for the given custom ID, ordered alphabetically in pages of 100.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Custom Item Batch


Set up to 20 data items with key, value and optional writeLock against the custom ID. The values are limited to a maximum size of 5 MB across all default access level slots for the custom ID. The entire default access level saved state for a custom ID is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Default Custom Data


Query custom data with the default access class. If no index is available to fulfil the query then the query will fail
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get
Client
HTTP: Client
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

Set Private Custom Item


Set a private data item with a given key and value for the specified custom ID. The value is limited to a maximum size of 5 MB across all private access level slots. The entire private saved state for a custom ID is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0"}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/items"

Response example

{ "writeLock": "efac747f6fb244569efef962ca9dc30e"}

Get Private Custom Items


Retrieves private save data values for all keys specified, ordered alphabetically in pages of 20. If no keys are supplied then returns all keys, ordered alphabetically in pages of 20. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Query parameters for "{title}"

keys

The keys to retrieve, in exploded form style, e.g.
keys=KEY1&keys=KEY2&keys=KEY3
.

after

string
The key after which to retrieve the next page of keys.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/items"

Response example

{ "results": [], "links": { "next": "string" }}

Delete Private Custom Items


Deletes all private data associated with a given custom ID. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/items"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Delete Private Custom Item


Deletes a private data item by the specified key for the specified custom ID. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing data item. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Private Custom Keys


Gets a paged list of private keys for the given custom ID, ordered alphabetically in pages of 100. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Query parameters for "{title}"

after

Returns the page of results after the key specified.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/keys"

Response example

{ "results": [ { "key": "KEY1", "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0", "modified": { "date": "2020-02-20T20:20:20Z" } } ], "links": { "next": "string" }}

Set Private Custom Item Batch


Set up to 20 private data items with key, value and optional writeLock against the custom ID. The values are limited to a maximum size of 5 MB across all private access level slots for the custom ID. The entire private saved state for a custom ID is limited to 2000 keys. Attempting to set a new key beyond this limit will result in an error. The batch set operation is considered atomic and if any of the set key operation fails, the entire operation is failed. Error responses should identify the affected key operations that failed. Only accessible via an authenticated server authority.
Authorizations
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

customId

string
必填
example: my-custom-data-id
The custom data ID specified by the user. Must be between 1 and 50 characters long and contain only alphanumeric characters, underscores, and hyphens.

Request body for "{title}"

Media Type:
application/json

data

array[object]
No description

key

必填
The key will be created if it does not exist, provided the item limit of 2000 keys has not been reached for this entity.

value

object
必填
Any JSON serializable structure with a maximum size of 5 MB.

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "data": [ { "key": "ItemKey", "value": { "Health": 87, "Array": [ 23, 12, 123 ], "Object": { "weapon": "Sword", "damage": 3, "durability": 46 } }, "writeLock": "7b8920a57912509f6b5cbb183eb7fcb0" } ]}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/{customId}/private/item-batch"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e" } ]}

Query Private Custom Data


Query custom data with the private access class. If no index is available to fulfil the query then the query will fail.
Authorizations
ServiceAccount (cloud_save.indexes.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer
Required scopes: cloud_save.indexes.get

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

Request body for "{title}"

Media Type:
application/json

fields

array[object]
必填
No description

key

string
必填
example: EXAMPLE_KEY
Item key

value

object
必填
The indexed Cloud Save value

op

string
必填
The comparison operator to use for the filter. The specified value is compared to the indexed value (lexicographically for string data, numerically for numerical data) using one of the following operators:
  • EQ
    - Equal
  • NE
    - Not Equal
  • LT
    - Less Than
  • LE
    - Less Than or Equal
  • GT
    - Greater Than
  • GE
    - Greater Than or Equal

asc

boolean
必填
Whether the field is sorted in ascending order

returnKeys

array[string]
The keys to return in the response. This can include keys not on the index. If not specified or empty, the data on the results will be empty for any returned entities.

offset

integer
The number of results to skip. Defaults to 0.

limit

integer
The maximum number of results to return. Defaults to 10. Specifying 0 will return the default number of results.

sampleSize

integer
If set, the given number of random items will be chosen from the total query results and returned as a sample. Defaults to null.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "fields": [ { "key": "EXAMPLE_KEY", "value": {}, "op": "EQ", "asc": true } ], "returnKeys": [ "EXAMPLE_KEY" ], "offset": 0, "limit": 0, "sampleSize": 0}' \ "https://cloud-save.services.api.unity.com/v1/data/projects/{projectId}/custom/private/query"

Response example

{ "results": [ { "id": "s1QFdyYFXCC2YBocplKoLstxvQ2r", "data": [ { "key": "EXAMPLE_KEY", "value": {}, "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": null }, "created": { "date": null } } ] } ]}

List Player Files


Retrieves a list of names of all the files currently saved in storage for a player along with size (in bytes), last date modified and current WriteLock. Ordered alphabetically in page sizes of 20.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

Query parameters for "{title}"

after

string
The key after which to retrieve the next page of files.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/files/projects/{projectId}/players/{playerId}/items"

Response example

{ "results": [ { "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": "2020-04-01T13:07:23Z" }, "created": { "date": "2020-04-01T13:07:23Z" }, "contentType": "text/plain", "size": 2048 } ], "links": { "next": "string" }}

Get Player File Download URL


Generates a signed URL that will allow the client to download the requested player file for a limited period of time. If successful, an object will be returned containing all necessary information to perform the download.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/files/projects/{projectId}/players/{playerId}/items/{key}"

Response example

{ "signedUrl": "string", "httpMethod": "string", "requiredHeaders": {}}

Get Player File upload URL


Initiates the player file upload process and returns a URL to which the actual file contents can be uploaded. The type, length and MD5 hash of the file have to be provided up-front. If successful, an object will be returned containing all necessary information to perform the upload.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Request body for "{title}"

Media Type:
application/json

contentType

string
必填
The MIME type of the file that will be uploaded

contentLength

integer
必填
The content length in bytes of the file that will be uploaded

contentMd5

string
必填
The base64 encoded MD5 checksum of the file contents that will be uploaded

writeLock

string
example: efac747f6fb244569efef962ca9dc30e
Enforces conflict checking when updating an existing data item. This field should be omitted when creating a new data item. When updating an existing item, omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Content-Type: application/json" \ -d '{ "contentType": "string", "contentLength": 0, "contentMd5": "string", "writeLock": "efac747f6fb244569efef962ca9dc30e"}' \ "https://cloud-save.services.api.unity.com/v1/files/projects/{projectId}/players/{playerId}/items/{key}"

Response example

{ "signedUrl": "string", "httpMethod": "string", "requiredHeaders": {}}

Delete Player File


Deletes the specified player file. If a WriteLock is provided, the file will only be deleted if it matches the stored WriteLock.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

Query parameters for "{title}"

writeLock

Enforces conflict checking when deleting an existing file. Omitting this field ignores write conflicts. When present, an error response will be returned if the writeLock in the request does not match the stored writeLock.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/files/projects/{projectId}/players/{playerId}/items/{key}"

Response example

{ "type": "problems/basic", "title": "service unavailable", "status": 500, "code": 1000, "detail": "service unavailable", "details": [ { "health": [ "service health ping failed" ] } ]}

Get Player File Metadata


Retrieves the metadata (size, date last modified and created, key, content type, and current WriteLock) of a single player file.
Authorizations
Client
HTTP: Client
HTTP Authorization Scheme: bearer
ServiceAccount
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: bearer

Path parameters for "{title}"

projectId

string
必填
example: 8bdacc33-6eef-4577-beb0-633c86259f5b
ID of the project.

playerId

string
必填
example: s1QFdyYFXCC2YBocplKoLstxvQ2r
The player ID supplied by the Authorization service.

key

必填
Item key.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Bearer <YOUR_TOKEN>" \ -H "Authorization: Bearer <YOUR_TOKEN>" \ "https://cloud-save.services.api.unity.com/v1/files/projects/{projectId}/players/{playerId}/items/{key}/metadata"

Response example

{ "key": "EXAMPLE_KEY", "writeLock": "efac747f6fb244569efef962ca9dc30e", "modified": { "date": "2020-04-01T13:07:23Z" }, "created": { "date": "2020-04-01T13:07:23Z" }, "contentType": "text/plain", "size": 2048}

Copyright © 2026 Unity Technologies
法律信息隐私政策CookiesDocumentation Terms of Use请勿出售或分享我的个人信息您的隐私选择(Cookie 设置)

“Unity”、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属公司在美国和其他地方的商标或注册商标(此处查看更多信息)。其他名称或品牌是其各自所有者的商标。

为方便起见,一些页面是机器翻译的,可能包含不准确的内容。如有信息不一致的情况,以英文版本为准。