Endorse Account

post
Endorse Account

https://api.bountyblok.io/v1/endorse_account
This endpoint allows you to log an endorsement between 2 users.
Request
Response
Request
Headers
Authorization
required
string
Bearer <<YOUR_API_KEY>>
Body Parameters
app_id
required
string
The app id of the app or website where endorsements can occur.
from_account
required
string
The account name or username of the endorser.
to_account
required
string
The account name or username of the user receiving the endorsement.
endorsement_id
required
string
The endorsement id associated to a specific user defined endorsement category. Example: "Good sportsman ship", "Very Talented", "Superstar" etc.
Response
200: OK
Cake successfully retrieved.
{ "name": "Cake's name", "recipe": "Cake's recipe name", "cake": "Binary cake"}
404: Not Found
Could not find a cake matching this query.
{ "message": "Ain't no cake like that."}
cURL
C#
Javascript
Python
PHP
cURL
curl --request POST
--url 'https://api.bountyblok.io/v1/endorse_account'
--header 'authorization: Bearer <<YOUR_API_KEY>>'
--header 'content-type: application/json'
--data '{"app_id":"c81f7974-d08e-451f-9405-6818478cadf0","from_account":"mike123","to_account":"cathy333","endorsement_id":"997f45ba-09ed-4405-a708-9387e470cd7d"}'
C#
var client = new RestClient("
https://api.bountyblok.io/v1/endorse_account
");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Bearer <<YOUR_API_KEY>>");
request.AddParameter("application/json", "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"from_account\":\"mike123\",\"to_account\":\"laura333\",\"endorsement_id\":\"997f45ba-09ed-4405-a708-9387e470cd7d\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Javascript
var data = JSON.stringify({
"app_id": "c81f7974-d08e-451f-9405-6818478cadf0",
"from_account": "mike123",
"to_account": "kathy333",
"endorsement_id":"997f45ba-09ed-4405-a708-9387e470cd7d",
});
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/endorse_account");
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\",\"from_account\":\"mike123\",\"to_account\":\"kathy333\",\"endorsement_id\":\"997f45ba-09ed-4405-a708-9387e470cd7d\"}"
headers = {
'authorization': "Bearer <<YOUR_API_KEY>>",
'content-type': "application/json"
}
conn.request("POST", "/v1/endorse_account", 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/endorse_account",
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\",\"from_account\":\"mike123\",\"to_account\":\"kathy333\",\"endorsement_id\":\"997f45ba-09ed-4405-a708-9387e470cd7d\"}",
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;
}