Key/Value Store
This service provides a flexible, runtime-accessible key/value store for persisting arbitrary data. It can be used by both game clients and servers to cache, retrieve, and manage state and user data.
Read KVStore data for the specified keys and from the specified stores. If a World ID or Launch Context ID header are supplied, the respective Project ID header must also be supplied.
Data can be read from either the client or server store by both the user and Unreal server or service accounts. Client store data can only be written by the user whose store it is but can be read by the user and an Unreal server or service account. The server store can only be written by the Unreal server or service account but may be read by both the user and the server.
The ID of an organization
The ID of a project
The ID of a launch context
The ID of a world
Request to read from a KV Store for a given user, store and key.
The ID of the user who's store is being accessed
Client or Server KV Store
The key of the value of interest
POST /api/kvstore/read/ HTTP/1.1
Host: your-organization-id.m2worlds.io
Authorization: Bearer YOUR_SECRET_TOKEN
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 52
[
{
"id": "text",
"store": "kvstoreClient",
"key": "text"
}
]
[
{
"status": "ok",
"id": "text",
"store": "kvstoreClient",
"object": {
"key": "text",
"data": null
}
}
]
List all keys for the specified store. If a World ID header is supplied, the Project ID header must also be supplied. Keys can be read from either the client or server store by both the user and the Unreal server.
Client or Server KV Store
The ID of an organization
The ID of a project
The ID of a world
GET /api/kvstore/keys/ HTTP/1.1
Host: your-organization-id.m2worlds.io
Authorization: Bearer YOUR_SECRET_TOKEN
x-m2-organization-id: text
Accept: */*
{
"keys": [
"text"
]
}
Delete entries for the specified keys from the specified store for the current user. If a World ID header is supplied, the Project ID header must also be supplied. Keys can be deleted from either the client or server store. This operation is non-recursive and only affects the specified scope level.
The ID of an organization
The ID of a project
The ID of a world
The request body for deleting specific keys from a KV Store.
The key to delete from the store
Client or Server KV Store
Indicates the KV Store was successfully cleared.
POST /api/kvstore/keys/delete/ HTTP/1.1
Host: your-organization-id.m2worlds.io
Authorization: Bearer YOUR_SECRET_TOKEN
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 40
[
{
"key": "text",
"store": "kvstoreClient"
}
]
{}
Upsert KVStore data for the specified keys and from the specified stores. If a World ID or Launch Context ID header are supplied, the respective Project ID header must also be supplied.
Any existing data under the given keys will be overwritten.
Data can be read from either the client or server store by both the user and Unreal server or service accounts. Client store data can only be written by the user who's store it is but can be read by the user and an Unreal server or service account. The server store can only be written by the Unreal server or service account but may be read by both the user and the server.
The ID of an organization
The ID of a project
The ID of a launch context
The ID of a world
The request body for a KV Store upsert request.
The ID of the user who's store is being accessed
Client or Server KV Store
The key of the value of interest
The data to upsert against the passed key in the specified store
POST /api/kvstore/upsert/ HTTP/1.1
Host: your-organization-id.m2worlds.io
Authorization: Bearer YOUR_SECRET_TOKEN
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 64
[
{
"id": "text",
"store": "kvstoreClient",
"key": "text",
"data": null
}
]
[
{
"id": "text",
"store": "kvstoreClient",
"object": {
"key": "text",
"data": null
}
}
]
Delete all KVStore data except for the specified keys. If a World ID or Launch Context ID header are supplied, the respective Project ID header must also be supplied.
Both the client and server data will be cleared at the given level only. i.e. clearing the Organization store will not have an impact on any child Projects, Launch Contexts, nor Worlds.
The ID of an organization
The ID of a project
The ID of a launch context
The ID of a world
The request body for a KV Store delete request.
An array of keys to ignore when clearing the store
Client or Server KV Store
Indicates the KV Store was successfully cleared.
POST /api/kvstore/delete/ HTTP/1.1
Host: your-organization-id.m2worlds.io
Authorization: Bearer YOUR_SECRET_TOKEN
x-m2-organization-id: text
Content-Type: application/json
Accept: */*
Content-Length: 49
{
"keysToIgnore": [
"text"
],
"store": "kvstoreClient"
}
{}
Last updated
Was this helpful?