Get Task

get
Get Task

https://api.bountyblok.io/v1/get_task
This endpoint allows you to retrieve this task's details.
Request
Response
Request
Headers
Authorization
required
string
Bearer <<YOUR_API_KEY>>
Query Parameters
task_id
required
string
The task_id of the task that is being retrieved.
Response
200: OK
Task successfully retrieved.
{
"task_id": "cb9bdd69-6e26-4279-a292-5fa330c17823",
"name": "buy us stocks 50 times",
"quantity": 50,
"operator": 1,
"metadata": "{\"orderside\":\"buy\",\"exchange\":\"us\",\"securitytype\":\"equities\"}",
"create_date": "2019-07-19t13:34:17",
"resourceurl": null,
"challenge": {
"challenge_id": "b0daa55c-d444-4375-8465-9b3d00af237e",
"name": "htmw global challenge",
"description": "global stats challenge",
"create_date": "2019-07-19t13:33:35",
"groupid": null,
"badge": null,
"tasks": null,
"rewarddata": null,
"is_valid": false,
"message": null
},
"is_valid": false,
"message": null
}
404: Not Found
Could not find a task matching this query.
{
"is_valid": false,
"message": "Task was not found."
}
cURL
C#
Javascript
Python
PHP
cURL
curl --request GET
--url 'https://api.bountyblok.io/v1/get_task?task_id=1606DC72-A915-4975-95BA-64CAE14800E0'
--header 'authorization: Bearer <<YOUR_API_KEY>>'
--data '{}'
C#
var client = new RestClient("https://api.bountyblok.io/v1/get_task?task_id=1606DC72-A915-4975-95BA-64CAE14800E0");
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_task?task_id=1606DC72-A915-4975-95BA-64CAE14800E0");
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_task?task_id=1606DC72-A915-4975-95BA-64CAE14800E0", 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_task?task_id=1606DC72-A915-4975-95BA-64CAE14800E0",
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;
}