curl --request PATCH \
--url https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"challengeIds": [
"<string>"
],
"activeAmount": 2,
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
}
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}"
payload = {
"challengeIds": ["<string>"],
"activeAmount": 2,
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
}
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
challengeIds: ['<string>'],
activeAmount: 2,
details: {
title: '<string>',
description: '<string>',
light: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'},
dark: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'}
}
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}', 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/challenge-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'challengeIds' => [
'<string>'
],
'activeAmount' => 2,
'details' => [
'title' => '<string>',
'description' => '<string>',
'light' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
],
'dark' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
]
]
]),
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/challenge-groups/{id}"
payload := strings.NewReader("{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"communityId": "<string>",
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"type": "random",
"period": "daily",
"challengeIds": [
"<string>"
],
"activeAmount": 2,
"status": "archived",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Update a challenge group by id
Update a challenge group by id.
curl --request PATCH \
--url https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-token: <api-key>' \
--data '
{
"challengeIds": [
"<string>"
],
"activeAmount": 2,
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
}
}
'import requests
url = "https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}"
payload = {
"challengeIds": ["<string>"],
"activeAmount": 2,
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
}
}
headers = {
"x-api-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
challengeIds: ['<string>'],
activeAmount: 2,
details: {
title: '<string>',
description: '<string>',
light: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'},
dark: {primaryImageUrl: '<string>', secondaryImageUrl: '<string>'}
}
})
};
fetch('https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}', 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/challenge-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'challengeIds' => [
'<string>'
],
'activeAmount' => 2,
'details' => [
'title' => '<string>',
'description' => '<string>',
'light' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
],
'dark' => [
'primaryImageUrl' => '<string>',
'secondaryImageUrl' => '<string>'
]
]
]),
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/challenge-groups/{id}"
payload := strings.NewReader("{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}")
.header("x-api-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/admin/challenge-groups/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"challengeIds\": [\n \"<string>\"\n ],\n \"activeAmount\": 2,\n \"details\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"light\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n },\n \"dark\": {\n \"primaryImageUrl\": \"<string>\",\n \"secondaryImageUrl\": \"<string>\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"organisationId": "<string>",
"communityId": "<string>",
"details": {
"title": "<string>",
"description": "<string>",
"light": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
},
"dark": {
"primaryImageUrl": "<string>",
"secondaryImageUrl": "<string>"
}
},
"type": "random",
"period": "daily",
"challengeIds": [
"<string>"
],
"activeAmount": 2,
"status": "archived",
"createdAt": "<string>",
"updatedAt": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "NOT_FOUND",
"message": "Not found",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Headers
The language to update the challenge group in. This will update the challenge group's content for the specified language.
Path Parameters
The id of the challenge group
^[0-9a-fA-F]{24}$Body
The input required to update a challenge group
The challenge group status
archived, draft, expired, live, scheduled The challenge selection type
random, sequential The rotation period
daily, weekly, monthly, yearly, open The challenge IDs in this group
^[0-9a-fA-F]{24}$Number of active challenges to show
x >= 1Input for updating entity details with all fields optional
Show child attributes
Show child attributes
Response
Successful response
A challenge group
The id of the challenge group
^[0-9a-fA-F]{24}$The id of the organisation the challenge group belongs to
^[0-9a-fA-F]{24}$The id of the community the challenge group belongs to
^[0-9a-fA-F]{24}$Used to describe an entity
Show child attributes
Show child attributes
The challenge selection type
random, sequential The rotation period
daily, weekly, monthly, yearly, open The challenge IDs in this group
^[0-9a-fA-F]{24}$Number of active challenges to show
x >= 1The challenge group status
archived, draft, expired, live, scheduled The creation date of the challenge group
The update date of the challenge group
Was this page helpful?

