DataApi
Import
Import
Constructors
Constructor
-
Parameters
-
Optional configuration: Configuration
-
basePath: string = ...
-
axios: AxiosInstance = ...
Returns DataApi
-
Methods
Delete Item
-
Parameters
-
key: string
Item key.
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional writeLock: string
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<void>>
-
Delete Items
-
Deletes all data associated with a given player.
Parameters
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<void>>
-
Get Items
-
Retrieves 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.
Parameters
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional keys: string[]
-
Optional after: string
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<GetItemsResponse>>
-
Get Keys
-
Gets a paged list of keys for the given player, ordered alphabetically in pages of 100.
Parameters
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional after: string
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<GetKeysResponse>>
-
Set Item
-
Set a data item with a given key and value for the specified player. The value is limited to a maximum size of 16KB. The entire save state for a player is limited to 200 keys. Attempting to set a new key beyond this limit will result in an error.
Parameters
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional setItemBody: SetItemBody
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<SetItemResponse>>
-
Set Item Batch
-
Set up to 20 data items with key, value and optional writeLock. The values are each limited to a maximum size of 16KB. The entire save state for a player is limited to 200 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.
Parameters
-
projectId: string
ID of the project.
-
playerId: string
The player ID supplied by the Authorization service.
-
Optional setItemBatchBody: SetItemBatchBody
-
Optional options: AxiosRequestConfig
Returns Promise<AxiosResponse<SetItemBatchResponse>>
-
Deletes a data item by the specified key.
Delete Item
{RequiredError}
DataApi