I am attempting to perform an http get request with the Twitter 2.0 API to return a conversation using the conversation_id request.
It is returning only the main tweet, but is not returning the replies to the tweet. Can anyone tell me what I am doing incorrectly? Any help would be greatly appreciated.
import 'package:http/http.dart';
import 'dart:convert';
class TwitterService{
final String twitterUrl =
'https://api.twitter.com/2/tweets?ids=1176434159520075777&tweet.fields=author_id,conversation_id,created_at,in_reply_to_user_id,referenced_tweets&expansions=author_id,in_reply_to_user_id,referenced_tweets.id&user.fields=name,username'
;
getPosts() async{
Response response = await get(Uri.parse(twitterUrl),
headers: {
'Authorization': 'Bearer $BEARERTOKEN',
}
);
if(response.statusCode == 200) {
String tweetList = response.body;
var collection = json.decode(tweetList);
print(collection);
return collection;
} else {
print('error');
}
}
}