v24
Create/Update Record
post
https://leaderboard-example.lvis.io
/base_url/records
Create/update record
All and any of the values can be null or omitted in which case they are ignored.

Example

1
curl --request POST \
2
--url https://leaderboard-example.lvis.io/api/projects/edc619ed-32f3-4dcc-a2e6-1d213fbaf6a0/leaderboards/season/records \
3
--header 'Authorization: Bearer JmsmU5gZb6xNVUgQGoKcQLvQjRhKAUSb' \
4
--header 'Content-Type: application/vnd.api+json' \
5
--data '{
6
"public_id": "user_8163",
7
"score": 16538,
8
"name": "John Doe",
9
"level": "Rookie",
10
"public_data": "{\"avatar_url\":\"//example.com/avatar.jpg\"}",
11
"private_data": "{\"private_access_key\":\"Idq8gf886djh8918\"}"
12
}'
Copied!

Records without score

If the score is missing or is null, then the record is not ranked in any way and is not returned in ranking requests, such as "Fetch top N players" or "Fetch total ranked players", but it is still possible to access this record by public_id or private_id.

Private and Public IDs truncation

If private_id or public_id is longer than allowed, it will be silently truncated to maximum allowed length.

Missing private_id

If private_id is omitted, a new is record created and private_id is generated by the system (random UUID). If private_id is present and record with this ID does not exist yet then a new record is created with given private_id. If private_id is present and the record exists it is updated with new data.

Public ID uniqueness

Public ID is not required to be unique across leaderboard records. In case if a non-unique public ID is used in "GET /ranks/public" query, the first record posted with the requested public ID is returned.

Private and public data size limit

A request is ignored if either private or public data exceed size limit.
Last modified 2yr ago