twitter-api-java-sdk
twitter-api-java-sdk copied to clipboard
Get response fields by defining the excluded fields.
Add an option to easily define the retrieved response fields.
Instead of defining which fields should be in the response object, define which fields should be excluded from it.
Call .excludeInputFields()
in order to invoke this functionality.
e.g.
Set<String> tweetFields = new HashSet<>();
tweetFields.add("non_public_metrics");
tweetFields.add("promoted_metrics");
tweetFields.add("organic_metrics");
// Get all available fields excluding Tweet Fields `non_public_metrics`, `promoted_metrics` & `organic_metrics`
Get2TweetsIdResponse result = apiInstance.tweets().findTweetById("20")
.tweetFields(tweetFields).excludeInputFields().execute();
// Get all the response fields
Get2TweetsIdResponse result2 = apiInstance.tweets().findTweetById("20").excludeInputFields().execute();
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
tmoskovitch seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
@zacmos I like the idea. I spend some time digging through the sdk to find out how to retrieve / expand additional feeds .