Closed 9oTbvP8v4L closed 2 years ago
Update: if I pass nul as access token and access token secret (so RequestHelperV2 is used), it throws
ERROR i.g.r.t.h.AbstractRequestHelper - (POST) Error calling https://api.twitter.com/oauth2/token {"errors":[{"code":99,"message":"Unable to verify your credentials","label":"authenticity_token_error"}]} - 403
I think that TwitterCredentials should have one more parameter (bearerToken), possible #313?
Hello, Currently you cannot use only a bearer token for the library. Are you sure that your twitter dev account is valid and that your credentials are working ? Did you try to make a call from postman for example ?
Hi, unfortunately, I'm not able to call any methods from the library's client. So I'm calling twitter API directly, just using your DTOs to parse results (this approach works). Yeah, I'm pretty sure the creds are valid.
That's really strange, you're the first user to face this problem. Could you please try another constructor ? Like using a json file ?
Hey, is it solved ?
I am facing similar issue.
twitterClient.getUserTimeline("someuser")
.getData()
.stream()
.map(TweetV2.TweetData::getText)
.forEach(System.out::println);
Error:
12:12:49.007 [main] ERROR io.github.redouane59.twitter.helpers.AbstractRequestHelper - (GET) Error calling https://api.twitter.com/2/users/someuser/tweets {"errors":[{"parameters":{"id":["someuser"]},"message":"The `id` query parameter value [someuser] is not valid"}],"title":"Invalid Request","detail":"One or more parameters to your request was invalid.","type":"https://api.twitter.com/2/problems/invalid-request"} - 400
Interestingly it works.
Tweet tweet = twitterClient.getTweet("1224041905333379073");
System.out.println(tweet.getText());
System.out.println(tweet.getCreatedAt());
System.out.println(tweet.getLang());
System.out.println(tweet.getLikeCount());
System.out.println(tweet.getRetweetCount());
System.out.println(tweet.getReplyCount());
System.out.println(tweet.getUser().getName());
twitterClient.getUserTimeline("someuser")
are you sure to call the function with the userid, not the username ?
Hi, I'm trying to run example from README with this piece of code
But it throws
ERROR i.g.r.t.h.AbstractRequestHelper - (GET) Error calling https://api.twitter.com/2/users/by/username/RedouaneBali {"title":"Unauthorized","detail":"Unauthorized","type":"about:blank","status":401} - 401
Any ideas?