twitter-api-java-sdk
twitter-api-java-sdk copied to clipboard
tweets().searchStream().execute() throws 400 error with no response body if additional parameters are included
TwitterApi.tweets().searchStream().execute() throws 400 error with no response body if additional parameters are included
Expected behavior
defining the call as
Integer backfillMinutes = 1;
OffsetDateTime startTime = OffsetDateTime.parse("2022-10-01T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided.
OffsetDateTime endTime = OffsetDateTime.parse("2022-10-14T18:40:40.000Z"); // OffsetDateTime | YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided.
Set<String> tweetFields = new HashSet<>(Arrays.asList("conversation_id", "author_id")); // Set<String> | A comma separated list of Tweet fields to display.
apiInstance.tweets().searchStream()
.tweetFields(tweetFields)
.backfillMinutes()
.startTime(startTime)
.endTime(endTime)
.execute();
enables the additional functionality of those fields within the searchStream.
Actual behavior
when .execute() is called, a 400 APIException is thrown with a null message body
Steps to reproduce the behavior
As per the code above will reproduce this error. It is also discovered that .tweetFields() does not trigger this error, as does excluding all optional fields.
Thanks, I'll check it
Hi, I'm not supporting this project since I'm not in the organization anymore.
Regarding your error, Look here how to get the error message.
The problem is with the parameter that relates to Academic Research access.