Get Challenge

get
Get Challenge

https://api.bountyblok.io/v1/get_challenge
This endpoint allows you to retrieve this challenge's details. Includes the challenge task list.
Request
Response
Request
Headers
Authorization
required
string
Bearer <<YOUR_API_KEY>>
Query Parameters
challenge_id
required
string
The challenge id of the challenge that is being retrieved.
Response
200: OK
Challenge successfully retrieved.
{
"challenge_id": "0e2e2793-cdc1-4135-b301-d55674a587e2",
"name": "wss global challenge",
"description": "global stats challenge",
"create_date": "2019-07-19t13:26:21",
"groupid": null,
"badge": null,
"tasks": [
{
"task_id": "d15b2e75-1aa4-4880-8706-bb66be7e2265",
"name": "trade 50 securities",
"quantity": 50,
"operator": 1,
"metadata": "{\"orderside\":\"buy\",\"exchange\":\"us\"}",
"create_date": "2019-07-19t13:27:11",
"resourceurl": null,
"groupname": null,
"allowretry": false,
"alloweditquantity": false,
"challenge": null,
"is_valid": false,
"message": null
},
{
"task_id": "a37a8b30-4967-4a08-8d70-5d5f8d10ac67",
"name": "read 10 articles",
"quantity": 10,
"operator": 1,
"metadata": "{\"read\":\"any\"}",
"create_date": "2019-07-19t13:46:44",
"resourceurl": null,
"groupname": null,
"allowretry": false,
"alloweditquantity": false,
"challenge": null,
"is_valid": false,
"message": null
},
{
"task_id": "92b8d3c3-1379-4fe1-8882-622cb7c673ae",
"name": "create a contest",
"quantity": 1,
"operator": 1,
"metadata": "{\"create\":\"any\"}",
"create_date": "2019-07-19t13:47:19",
"resourceurl": null,
"groupname": null,
"allowretry": false,
"alloweditquantity": false,
"challenge": null,
"is_valid": false,
"message": null
}
],
"rewarddata": null,
"is_valid": false,
"message": null
}
404: Not Found
Specified challenge has not started yet.
{
"is_valid": false,
"message": "Challenge has not started"
}
cURL
C#
Javascript
Python
PHP
cURL
curl --request GET
--url 'https://api.bountyblok.io/v1/get_challenge?challenge_id=8A205981-61C9-4C27-BEA7-ED42AB787040'
--header 'authorization: Bearer <<YOUR_API_KEY>>'
--data '{}'
C#
var client = new RestClient("https://api.bountyblok.io/v1/get_challenge?challenge_id=8A205981-61C9-4C27-BEA7-ED42AB787040");
var request = new RestRequest(Method.GET);
request.AddHeader("authorization", "Bearer <<YOUR_API_KEY>>");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Javascript
var data = "{}";
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.bountyblok.io/v1/get_challenge?challenge_id=8A205981-61C9-4C27-BEA7-ED42AB787040");
xhr.setRequestHeader("authorization", "Bearer <<YOUR_API_KEY_HERE>>");
xhr.send(data);
Python
import http.client
conn = http.client.HTTPSConnection("api.bountyblok.io")
payload = "{}"
headers = { 'authorization': "Bearer <<YOUR_API_KEY>>" }
conn.request("GET", "/v1/get_challenge?challenge_id=8A205981-61C9-4C27-BEA7-ED42AB787040", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.bountyblok.io/v1/get_challenge?challenge_id=8A205981-61C9-4C27-BEA7-ED42AB787040",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => "{}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer <<YOUR_API_KEY_HERE>>"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}