User like a tweet
POST
https://us-central1-appgregator.cloudfunctions.net/twitter/likes/like-a-tweet/
Headers
Name
Type
Description
x-api-key*
String
43c464439b5507293ba7b315c9875907
Request Body
Name
Type
Description
name*
String
qantor.co.id
connection_name*
String
twitter-1
consumer_key*
String
A2e5O2q....
consumer_secret*
String
rfIzsxYoLbzb....
access_token*
String
245297600-2ESc....
token_secret*
String
d2dmLjbuK4A....
my_id*
String
245297600
tweet_id*
String
1542718751119925250
{
"liked": true
}
{
"type": "response",
"code": 400,
"error": {
"errors": [
{
"parameters": {
"tweet_id": [
"\"15427187511199252500\""
]
},
"message": "The `tweet_id` field in the request body value [15427187511199252500] is not valid"
}
],
"title": "Invalid Request",
"detail": "One or more parameters to your request was invalid.",
"type": "https://api.twitter.com/2/problems/invalid-request"
},
"rateLimit": {
"limit": 50,
"remaining": 49,
"reset": 1656854073
},
"headers": {
"date": "Sun, 03 Jul 2022 12:59:33 UTC",
"server": "tsa_b",
"set-cookie": [
"guest_id_marketing=v1%3A165685317371891716; Max-Age=63072000; Expires=Tue, 02 Jul 2024 12:59:33 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None",
"guest_id_ads=v1%3A165685317371891716; Max-Age=63072000; Expires=Tue, 02 Jul 2024 12:59:33 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None",
"personalization_id=\"v1_4tr5kLVkYsH1ypSbBgC5fQ==\"; Max-Age=63072000; Expires=Tue, 02 Jul 2024 12:59:33 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None",
"guest_id=v1%3A165685317371891716; Max-Age=63072000; Expires=Tue, 02 Jul 2024 12:59:33 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None"
],
"api-version": "2.45",
"content-type": "application/json; charset=utf-8",
"cache-control": "no-cache, no-store, max-age=0",
"content-length": "236",
"x-access-level": "read-write",
"x-frame-options": "SAMEORIGIN",
"content-encoding": "gzip",
"x-xss-protection": "0",
"x-rate-limit-limit": "50",
"x-rate-limit-reset": "1656854073",
"content-disposition": "attachment; filename=json.json",
"x-content-type-options": "nosniff",
"x-rate-limit-remaining": "49",
"strict-transport-security": "max-age=631138519",
"x-response-time": "19",
"x-connection-hash": "0f2d60f26a941209644bed1f10fab15d7ae207ce738f20642e2bdff0e6afee4b",
"connection": "close"
}
}
Body JSON
{
"name" : "qantor.co.id",
"connection_name" : "twitter-1",
"consumer_key" : "A2e5O2q....",
"consumer_secret" : "rfIzsxYoLbzb....",
"access_token" : "245297600-2ESc....",
"token_secret" : "d2dmLjbuK4A....",
"my_id" : "245297600",
"tweet_id": "1542718751119925250"
}
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/twitter/likes/like-a-tweet' \
--header 'x-api-key: 43c464439b5507293ba7b315c9875907' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "qantor.co.id",
"connection_name" : "twitter-1",
"consumer_key" : "A2e5O2q....",
"consumer_secret" : "rfIzsxYoLbzb....",
"access_token" : "245297600-2ESc....",
"token_secret" : "d2dmLjbuK4A....",
"my_id" : "245297600",
"tweet_id": "1542718751119925250"
}'
var axios = require('axios');
var data = JSON.stringify({
"name": "qantor.co.id",
"connection_name": "twitter-1",
"consumer_key": "A2e5O2q....",
"consumer_secret": "rfIzsxYoLbzb....",
"access_token": "245297600-2ESc....",
"token_secret": "d2dmLjbuK4A....",
"my_id": "245297600",
"tweet_id": "1542718751119925250"
});
var config = {
method: 'post',
url: 'https://us-central1-appgregator.cloudfunctions.net/twitter/likes/like-a-tweet',
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 => 'https://us-central1-appgregator.cloudfunctions.net/twitter/likes/like-a-tweet',
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" : "A2e5O2q....",
"consumer_secret" : "rfIzsxYoLbzb....",
"access_token" : "245297600-2ESc....",
"token_secret" : "d2dmLjbuK4A....",
"my_id" : "245297600",
"tweet_id": "1542718751119925250"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: 43c464439b5507293ba7b315c9875907',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Last updated