Skip to main content
View as Markdown

User Scores & Progress - Gamification

User Scores & Progress​

10.1 Get User Score​

Parameters

ParameterTypeRequiredDescription
gameObjectIdstringYesID of the leaderboard, badge, certificate, or lead scoring profile
userIdstringYesKaltura user ID to look up
curl -X POST "$KALTURA_SCM_URL/userScore/get" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"gameObjectId": "'$LEADERBOARD_ID'", "userId": "'$USER_ID'"}'

10.2 List Scores (Paginated Ranking)​

curl -X POST "$KALTURA_SCM_URL/userScore/list" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"gameObjectId": "'$LEADERBOARD_ID'", "pager": {"pageSize": 25, "pageIndex": 1}}'

10.3 Per-Rule Progress​

curl -X POST "$KALTURA_SCM_URL/userScore/ruleProgress" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"gameObjectId": "'$LEADERBOARD_ID'", "userId": "'$USER_ID'"}'

10.4 Clear Scores​

Parameters

ParameterTypeRequiredDescription
gameObjectIdstringYesID of the leaderboard whose scores should be cleared. Removes all user scores for this leaderboard
curl -X POST "$KALTURA_SCM_URL/userScore/clear" \
-H "Authorization: Bearer $KALTURA_KS" \
-H "Content-Type: application/json" \
-d '{"gameObjectId": "'$LEADERBOARD_ID'"}'

10.5 API v3 Game Plugin​

User scores are also accessible via the standard Kaltura API v3:

curl -X POST "$KALTURA_SERVICE_URL/service/leaderboard_userscore/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[objectType]=KalturaUserScorePropertiesFilter" \
-d "filter[gameObjectType]=1" \
-d "filter[gameObjectId]=$LEADERBOARD_ID" \
-d "pager[pageSize]=25" \
-d "pager[pageIndex]=1"

Response: KalturaUserScorePropertiesResponse with rank, userId, puserId, score, scoreTags, oldRank.