Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
CallumWH opened this issue Oct 12, 2022 · 2 comments

Comments

@CallumWH
Copy link

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.

@zacmos
Copy link
Collaborator

zacmos commented Oct 16, 2022

Thanks, I'll check it

@zacmos
Copy link
Collaborator

zacmos commented Jan 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants