Skip to content

tweets().searchStream().execute() throws 400 error with no response body if additional parameters are included #47

Description

@CallumWH

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions