Twitter4j API 中的 DirectMessage 身份验证
我正在开发一个使用 Twitter4j API 的 Twitter 客户端项目。我的程序能够从时间轴读取推文,查看关注者和关注者列表,但每当我想访问 DirectMessage 时,它都会显示
errors:code:93-message:This application is not allowed to
access or delete your direct messages
我有以下内容 身份验证-
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(Static.CONSUMER_KEY,Static.CONSUMER_SECRET);
AccessToken accessToken = Static.CURRENT_USER_ACCESS_TOKEN;
twitter.setOAuthAccessToken(accessToken);
twitter = Static.CURRENT_TWITTER;
知道是什么导致了上述错误吗?
I am working with a twitter client project which is using the Twitter4j
API. My program is able to read tweets from the timeline, see followers and follower list, but whenever I want to access DirectMessage
it shows
errors:code:93-message:This application is not allowed to
access or delete your direct messages
I have following
authentication-
Twitter twitter = new TwitterFactory().getInstance();
twitter.setOAuthConsumer(Static.CONSUMER_KEY,Static.CONSUMER_SECRET);
AccessToken accessToken = Static.CURRENT_USER_ACCESS_TOKEN;
twitter.setOAuthAccessToken(accessToken);
twitter = Static.CURRENT_TWITTER;
Any idea what causes the error above?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当使用 twitter4j 访问 directmessage 时,错误显示“无法将 '3577866941' 解析为整数”。我已经设置了从 dev.twitter 获得的 ACCESS_TOKEN、ACCESSTOKEN_SECRET、CONSUMER_KEY、CONSUMER_SECRET 的值,但在应用程序运行时它崩溃了。我使用twitter4j-core-2.1.8-SNAPSHOT.jar 作为库。给出了代码吼叫。
谢谢。
When access directmessage using twitter4j, an error shows "unable to parse '3577866941' as integer".I have set the value of ACCESS_TOKEN,ACCESSTOKEN_SECRET,CONSUMER_KEY,CONSUMER_SECRET which I got from dev.twitter but it crashes when the application runs.I use twitter4j-core-2.1.8-SNAPSHOT.jar as library.The code is given bellow.
Thanks.
您需要“读取、写入和私信”权限才能读取/删除私信。
确保您的应用程序在 https://dev.twitter.com/apps 中处于适当的角色。
You need "Read, Write and Direct Messages" permission to read / delete direct messages.
Make sure that your application is in the appropriate role at https://dev.twitter.com/apps .