Connect Social
post
https://api.bountyblok.io
/v1/connect_social
Connect Social
cURL
C#
Javascript
Python
PHP
1
curl --request POST
2
--url 'https://api.bountyblok.io/v1/connect_social'
3
--header 'authorization: Bearer <<YOUR_API_KEY>>'
4
--header 'content-type: application/json'
5
--data '{"app_id":"c81f7974-d08e-451f-9405-6818478cadf0","account_name":"jeanguy","twitter_name":"dnikolaros"
6
Copied!
1
var client = new RestClient("
2
https://api.bountyblok.io/v1/connect_social
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\",\"account_name\":\"jeanguy\",\"twitter_name\":\"dnikolaros\"}", ParameterType.RequestBody);
9
10
IRestResponse response = client.Execute(request);
11
Copied!
1
var data = JSON.stringify({
2
"app_id": "d-8096b5dacb254c8b882816f22d1d11fe",
3
"account_name": "johnjohn1111",
4
"twitter_name":"dnikolaros"
5
});
6
7
var xhr = new XMLHttpRequest();
8
9
xhr.addEventListener("readystatechange", function () {
10
if (this.readyState === this.DONE) {
11
console.log(this.responseText);
12
}
13
});
14
15
xhr.open("POST", "https://api.bountyblok.io/v1/connect_social");
16
xhr.setRequestHeader("authorization", "Bearer <<YOUR_API_KEY>>");
17
xhr.setRequestHeader("content-type", "application/json");
18
19
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\",\"account_name\":\"jeanguy\",\"twitter_name\":\"dnikolaros\"}"
6
7
headers = {
8
'authorization': "Bearer <<YOUR_API_KEY>>",
9
'content-type': "application/json"
10
}
11
12
conn.request("POST", "/v1/connect_social", 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/connect_social",
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\",\"account_name\":\"jeanguy\",\"twitter_name\":\"dnikolaros\"}",
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