Connect Social

post
Connect Social

https://api.bountyblok.io/v1/connect_social
This endpoint allows you to save a user's profile over the Web API.
Request
Response
Request
Headers
Authorization
required
string
Bearer <<YOUR_API_KEY>>
Body Parameters
app_id
required
string
The app id where the profile will saved to.
account_name
required
string
The account name or username of the user being saved
twitter_name
required
string
The twitter name of the this user.
Response
200: OK
Cake successfully retrieved.
{
"is_valid": true,
"message": null
}
404: Not Found
Could not find a cake matching this query.
{
"is_valid": false,
"message": "Invalid app_id"
}
cURL
C#
Javascript
Python
PHP
cURL
curl --request POST
--url 'https://api.bountyblok.io/v1/connect_social'
--header 'authorization: Bearer <<YOUR_API_KEY>>'
--header 'content-type: application/json'
--data '{"app_id":"c81f7974-d08e-451f-9405-6818478cadf0","account_name":"jeanguy","twitter_name":"dnikolaros"
C#
var client = new RestClient("
https://api.bountyblok.io/v1/connect_social
");
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\",\"account_name\":\"jeanguy\",\"twitter_name\":\"dnikolaros\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Javascript
var data = JSON.stringify({
"app_id": "d-8096b5dacb254c8b882816f22d1d11fe",
"account_name": "johnjohn1111",
"twitter_name":"dnikolaros"
});
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/connect_social");
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\",\"twitter_name\":\"dnikolaros\"}"
headers = {
'authorization': "Bearer <<YOUR_API_KEY>>",
'content-type': "application/json"
}
conn.request("POST", "/v1/connect_social", 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/connect_social",
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\",\"twitter_name\":\"dnikolaros\"}",
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;
}