Complete challenge for user
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete \
--header 'x-api-token: <api-key>'import requests
url = "https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete"
headers = {"x-api-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-token': '<api-key>'}};
fetch('https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete', 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/integration/challenges/{challengeId}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-token", "<api-key>")
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/integration/challenges/{challengeId}/complete")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"completed": true,
"message": "<string>",
"distributionEventId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Challenge
Complete challenge for user
Validate and complete a challenge for user if all actions are done. Idempotent and safe against concurrent requests.
POST
/
challenges
/
{challengeId}
/
complete
Complete challenge for user
curl --request POST \
--url https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete \
--header 'x-api-token: <api-key>'import requests
url = "https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete"
headers = {"x-api-token": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-token': '<api-key>'}};
fetch('https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete', 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/integration/challenges/{challengeId}/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-token", "<api-key>")
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/integration/challenges/{challengeId}/complete")
.header("x-api-token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.nudj.cx/api/v2/integration/challenges/{challengeId}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"completed": true,
"message": "<string>",
"distributionEventId": "<string>"
}{
"code": "BAD_REQUEST",
"message": "Invalid input data",
"issues": []
}{
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error",
"issues": []
}Authorizations
Headers
The language to use for response messages. If not provided, the default language for the organisation will be used.
Path Parameters
The ID of the challenge to complete
Was this page helpful?
⌘I

