Log App

post
Log App

https://api.bountyblok.io/v1/log_app
This endpoint allows you to log a challenge task over the Web API.
Request
Response
Request
Headers
Authorization
required
string
Bearer <<YOUR_API_KEY>>
Body Parameters
app_id
required
string
The app id with the challenges you want to log
account_name
required
string
The account name or username of the user who is doing this task. Must be unique.
quantity
required
number
The quantity or amount of the task that is being logged.
param
required
string
JSON string of the parameters metadata for the task that is being logged. Example: {"order_side":"BUY","exchange":"US"}
Response
200: OK
App successfully logged.
{
"is_valid": true,
"message": null
}
404: Not Found
{
"is_valid": false,
"message": "Invalid app_id"
}
cURL
C#
Javascript
Python
PHP
cURL
curl --request POST \
--url 'https://api.bountyblok.io/v1/log_app' \
--header 'authorization: Bearer <<YOUR_API_KEY>>' \
--header 'content-type: application/json' \
--data '{"app_id":"c81f7974-d08e-451f-9405-6818478cadf0","account_name":"jeanguy","param":"PEP","quantity":1}'
C#
var client = new RestClient("
https://api.bountyblok.io/v1/log_app
");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer <>");
request.AddParameter("application/json", "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"account_name\":\"jeanguy\",\"param\":\"PEP\",\"quantity\":1}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Javascript
var data = JSON.stringify({
"app_id": "d-8096b5dacb254c8b882816f22d1d11fe",
"account_name": "johnjohn1111",
"quantity":1,
"param":"AAPL"
});
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.bountyblok.io/v1/log_app");
xhr.setRequestHeader("authorization", "Bearer <<YOUR_API_KEY>>");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Python
import http.client
conn = http.client.HTTPSConnection("api.bountyblok.io")
payload = "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"account_name\":\"jeanguy\",\"param\":\"PEP\",\"quantity\":1}"
headers = {
'authorization': "Bearer <<YOUR_API_KEY>>",
'content-type': "application/json"
}
conn.request("POST", "/v1/log_app", 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/log_app",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"account_name\":\"jeanguy\",\"param\":\"PEP\",\"quantity\":1}",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer <<YOUR_API_KEY>>",
"content-type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}