{
"following": true,
"pending_follow": false
}
{
"type": "response",
"code": 401,
"error": {
"title": "Unauthorized",
"type": "about:blank",
"status": 401,
"detail": "Unauthorized"
},
"headers": {
"content-type": "application/problem+json",
"cache-control": "no-cache, no-store, max-age=0",
"content-length": "99",
"x-response-time": "3",
"x-connection-hash": "c09dc70929a2c1f721b7e5b66e642a2598da9c4579ab339639f910037fec7a60",
"date": "Fri, 01 Jul 2022 07:25:37 GMT",
"server": "tsa_b",
"connection": "close"
}
}
curl --location --request POST 'http://localhost:5001/appgregator/us-central1/twitter/users/follow-user' \
--header 'x-api-key: 43c464439b5507293ba7b315c9875907' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "qantor.co.id",
"connection_name" : "twitter-1",
"consumer_key" : "A2e5O2...",
"consumer_secret" : "rfIzsxYo....",
"access_token" : "245297600-2ES....",
"token_secret" : "d2dmLjbuK4A....",
"my_id" : "245297600",
"target_user_id": "69231187"
}'
var axios = require('axios');
var data = JSON.stringify({
"name": "qantor.co.id",
"connection_name": "twitter-1",
"consumer_key": "A2e5O2...",
"consumer_secret": "rfIzsxYo....",
"access_token": "245297600-2ES....",
"token_secret": "d2dmLjbuK4A....",
"my_id": "245297600",
"target_user_id": "69231187"
});
var config = {
method: 'post',
url: 'http://localhost:5001/appgregator/us-central1/twitter/users/follow-user',
headers: {
'x-api-key': '43c464439b5507293ba7b315c9875907',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://localhost:5001/appgregator/us-central1/twitter/users/follow-user',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name" : "qantor.co.id",
"connection_name" : "twitter-1",
"consumer_key" : "A2e5O2...",
"consumer_secret" : "rfIzsxYo....",
"access_token" : "245297600-2ES....",
"token_secret" : "d2dmLjbuK4A....",
"my_id" : "245297600",
"target_user_id": "69231187"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: 43c464439b5507293ba7b315c9875907',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;