curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/leaderboards \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"name": "<string>",
"startsAt": "<string>",
"description": "<string>",
"expiresAt": "<string>",
"conditions": []
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards"
payload = {
"name": "<string>",
"startsAt": "<string>",
"description": "<string>",
"expiresAt": "<string>",
"conditions": []
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
startsAt: '<string>',
description: '<string>',
expiresAt: '<string>',
conditions: []
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/leaderboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'startsAt' => '<string>',
'description' => '<string>',
'expiresAt' => '<string>',
'conditions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.nudj.cx/api/v2/admin/leaderboards")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/leaderboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"name": "<string>",
"metricType": "consistent-weeks",
"period": "daily",
"startsAt": "<string>",
"status": "archived",
"conditions": [
{
"type": "community",
"communityId": "<string>"
}
],
"rewardsConfig": [
{
"startRank": 2,
"endRank": 2,
"distributionEventId": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"description": "<string>",
"expiresAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Create a new leaderboard configuration
Creates a leaderboard configuration that defines how user data should be aggregated
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/admin/leaderboards \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"name": "<string>",
"startsAt": "<string>",
"description": "<string>",
"expiresAt": "<string>",
"conditions": []
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards"
payload = {
"name": "<string>",
"startsAt": "<string>",
"description": "<string>",
"expiresAt": "<string>",
"conditions": []
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
startsAt: '<string>',
description: '<string>',
expiresAt: '<string>',
conditions: []
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/leaderboards', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'startsAt' => '<string>',
'description' => '<string>',
'expiresAt' => '<string>',
'conditions' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/admin/leaderboards"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.nudj.cx/api/v2/admin/leaderboards")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/leaderboards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"startsAt\": \"<string>\",\n \"description\": \"<string>\",\n \"expiresAt\": \"<string>\",\n \"conditions\": []\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"name": "<string>",
"metricType": "consistent-weeks",
"period": "daily",
"startsAt": "<string>",
"status": "archived",
"conditions": [
{
"type": "community",
"communityId": "<string>"
}
],
"rewardsConfig": [
{
"startRank": 2,
"endRank": 2,
"distributionEventId": "<string>"
}
],
"createdAt": "<string>",
"updatedAt": "<string>",
"createdBy": "<string>",
"updatedBy": "<string>",
"description": "<string>",
"expiresAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Body
The input required to create a leaderboard config
The name of the leaderboard
1The type of metric to track in the leaderboard
consistent-weeks, longest-streak, qualifying-active-days, total-actions-completed, total-challenges-completed, total-challenges-started, total-referrals, total-xp, unique-challenges-completed The start date of the leaderboard
The status of the leaderboard config
archived, draft, expired, live, scheduled The period for the leaderboard
daily, weekly, monthly, yearly, open The description of the leaderboard
The expiry date of the leaderboard
The conditions for leaderboard participation
- Option 1
- Option 2
Show child attributes
Show child attributes
Response
Successful response
A leaderboard configuration (admin view)
The id of the leaderboard config
^[0-9a-fA-F]{24}$The id of the organisation the leaderboard config belongs to
^[0-9a-fA-F]{24}$The name of the leaderboard
1The type of metric to track in the leaderboard
consistent-weeks, longest-streak, qualifying-active-days, total-actions-completed, total-challenges-completed, total-challenges-started, total-referrals, total-xp, unique-challenges-completed The period for the leaderboard (daily, weekly, monthly, yearly, open)
daily, weekly, monthly, yearly, open The start date of the leaderboard
The status of the leaderboard config
archived, draft, expired, live, scheduled The conditions that participants must meet to appear on this leaderboard
- Option 1
- Option 2
Show child attributes
Show child attributes
The reward configuration for different rank ranges
Show child attributes
Show child attributes
The creation date of the leaderboard config
The update date of the leaderboard config
The admin user who created this leaderboard config
The admin user who last updated this leaderboard config
The description of the leaderboard
The expiry date of the leaderboard
Was this page helpful?

