DataApi
Import
Import
Constructors
Constructor
-
Parameters
-
Optional configuration: Configuration
-
basePath: string = ...
-
axios: AxiosInstance = ...
Returns DataApi
-
Methods
Delete Item
-
Parameters
-
key: string
-
projectId: string
-
playerId: string
-
Optional writeLock: string
-
Optional options: any
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
-
playerId: string
-
Optional keys: string[]
-
Optional after: string
-
Optional options: any
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
-
playerId: string
-
Optional after: string
-
Optional options: any
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 1KB. 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
-
playerId: string
-
Optional setItemBody: SetItemBody
-
Optional options: any
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 1KB. 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
-
playerId: string
-
Optional setItemBatchBody: SetItemBatchBody
-
Optional options: any
Returns Promise<AxiosResponse<SetItemBatchResponse>>
-
Deletes a data item by the specified key.
Delete Item
{RequiredError}
DataApi