Endorse Account
post
https://api.bountyblok.io
/v1/endorse_account
Endorse Account
cURL
C#
Javascript
Python
PHP
1
curl --request POST
2
--url 'https://api.bountyblok.io/v1/endorse_account'
3
--header 'authorization: Bearer <<YOUR_API_KEY>>'
4
--header 'content-type: application/json'
5
--data '{"app_id":"c81f7974-d08e-451f-9405-6818478cadf0","from_account":"mike123","to_account":"cathy333","endorsement_id":"997f45ba-09ed-4405-a708-9387e470cd7d"}'
Copied!
1
var client = new RestClient("
2
https://api.bountyblok.io/v1/endorse_account
3
");
4
5
var request = new RestRequest(Method.POST);
6
request.AddHeader("content-type", "application/json");
7
request.AddHeader("authorization", "Bearer <<YOUR_API_KEY>>");
8
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);
9
10
IRestResponse response = client.Execute(request);
Copied!
1
var data = JSON.stringify({
2
"app_id": "c81f7974-d08e-451f-9405-6818478cadf0",
3
"from_account": "mike123",
4
"to_account": "kathy333",
5
"endorsement_id":"997f45ba-09ed-4405-a708-9387e470cd7d",
6
});
7
8
var xhr = new XMLHttpRequest();
9
10
xhr.addEventListener("readystatechange", function () {
11
if (this.readyState === this.DONE) {
12
console.log(this.responseText);
13
}
14
});
15
16
xhr.open("POST", "https://api.bountyblok.io/v1/endorse_account");
17
xhr.setRequestHeader("authorization", "Bearer <<YOUR_API_KEY>>");
18
xhr.setRequestHeader("content-type", "application/json");
19
20
xhr.send(data);
Copied!
1
import http.client
2
3
conn = http.client.HTTPSConnection("api.bountyblok.io")
4
5
payload = "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"from_account\":\"mike123\",\"to_account\":\"kathy333\",\"endorsement_id\":\"997f45ba-09ed-4405-a708-9387e470cd7d\"}"
6
7
headers = {
8
'authorization': "Bearer <<YOUR_API_KEY>>",
9
'content-type': "application/json"
10
}
11
12
conn.request("POST", "/v1/endorse_account", payload, headers)
13
14
res = conn.getresponse()
15
data = res.read()
16
17
print(data.decode("utf-8"))
18
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => "https://api.bountyblok.io/v1/endorse_account",
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => "",
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 30,
11
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
12
CURLOPT_CUSTOMREQUEST => "POST",
13
CURLOPT_POSTFIELDS => "{\"app_id\":\"c81f7974-d08e-451f-9405-6818478cadf0\",\"from_account\":\"mike123\",\"to_account\":\"kathy333\",\"endorsement_id\":\"997f45ba-09ed-4405-a708-9387e470cd7d\"}",
14
CURLOPT_HTTPHEADER => array(
15
"authorization: Bearer <<YOUR_API_KEY>>",
16
"content-type: application/json"
17
),
18
));
19
20
$response = curl_exec($curl);
21
$err = curl_error($curl);
22
23
curl_close($curl);
24
25
if ($err) {
26
echo "cURL Error #:" . $err;
27
} else {
28
echo $response;
29
}
30
Copied!
Last modified 1yr ago
Copy link