为什么会出现这个错误? - 只读应用程序无法 POST '

发布于 2024-12-20 00:39:51 字数 778 浏览 2 评论 0原文

Logcat:

12-05 23:37:01.721:W/System.err(534):  401:Authentication credentials  (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid     conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json

虽然我可以通过(getScreenName()函数)读取屏幕名称并设置对我的twitter应用程序的读、写权限,但它给出了上面的logcat。而且我正在使用twitter4j jar文件。

Logcat:

12-05 23:37:01.721:W/System.err(534):  401:Authentication credentials  (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid     conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json

Though i can read the screen name by (getScreenName() function) and set read,write permission to my twitter application , it gives the above logcat.And i am using twitter4j jar file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

哆兒滾 2024-12-27 00:39:52

重置权限后,您还必须撤销旧的权限。

  1. 前往
    https://twitter.com/settings/applications
  2. 找到你的应用,你会看到它有读取权限
  3. 撤销访问权限

You also have to revoke your old permission after you reset your permission.

  1. Go to
    https://twitter.com/settings/applications
  2. Find your app and you will see that it has read permission
  3. Revoke the access
恬淡成诗 2024-12-27 00:39:52

添加到 @Hemangi 答案,您不必重新生成消费者密钥和秘密。在您的 Twitter 开发者门户中,转到密钥和令牌选项卡并检查访问令牌

在此处输入图像描述

如果显示仅使用只读权限创建,请重新生成访问令牌和密钥并更新同样在你的代码。

输入图片此处描述

Adding to @Hemangi answer, you dont have to regenerate the consumer keys and secret. In your twitter developer portal go to the Keys and Tokens tab and check the access token

enter image description here

If it says created with only Read Only permissions, regenerate the Access Token and Secret and update the same in your code.

enter image description here

若言繁花未落 2024-12-27 00:39:52

您是否已在 Twitter 上注册了您的应用程序以获取您的消费者密钥?

Have you registered your application with twitter to get your consumer-secret key?

划一舟意中人 2024-12-27 00:39:52
  1. 转到 门户
  2. 选项:项目和项目应用程序选项卡。
  3. 在此选项中,转到设置、应用程序权限并将只读更改为读取+写入+发布读取直接消息
  4. 保存
  5. 最后,转到Keys and Tokens tab 并仅重新生成访问令牌和 Secret
  1. Go to portal
  2. Option: Projets & Apps tab.
  3. Inside this Option, go Setting, the App Permissions and change Read-only to Read + Write + Post Read Direct Messages
  4. Save
  5. Finally, go to the Keys and Tokens tab and regenerate only the Access token and Secret
心的位置 2024-12-27 00:39:51
  • 登录您的应用程序:http://dev.twitter.com/apps
  • 设置选项卡中,将应用程序类型更改为读取、写入和访问直接消息
  • 重置键选项卡中,按重置按钮,相应地更新应用程序中的消费者密钥和秘密。

看来重置按键会强制对应用程序类型的更改生效。

  • Login in your app: http://dev.twitter.com/apps
  • In the Settings tab, change the Application type to Read, Write and Access direct messages
  • In the Reset keys tab, press the Reset button, update the consumer key and secret in your application accordingly.

It looks like that resetting the keys force the change to your application type to take effect.

看透却不说透 2024-12-27 00:39:51

2022 更新

所有以前发布的解决方案不再有效。以下是当前的解决方案:

  1. 选择您的应用程序
  2. 编辑身份验证
  3. 设置启用 OAuth1
  4. 选择所需权限
  5. 输入回调 URL(可以是任何内容)
  6. 重新生成 API 令牌(注意:您必须执行此或此过程不起作用)

仪表板(步骤 1+2)

在此处输入图像描述

设置(步骤 3+4)

在此处输入图像描述

2022 UPDATE

all previously posted solutions don't work anymore. Here is the current solutiuon:

  1. select your app
  2. edit auth settings
  3. enable OAuth1
  4. select required permissions
  5. Enter the call back URL (it can be anything)
  6. Re-generate API Token (NOTE: you must do this or this process will not work)

dashboard (step 1+2)

enter image description here

settings (step 3+4)

enter image description here

姜生凉生 2024-12-27 00:39:51

转到 https://dev.twitter.com/ ->我的应用程序 -> “转到您当前的应用程序”->设置->授予“读、写和直接访问”权限 ->保存起来。之后从模拟器或设备中卸载您的项目,->清洁工程->运行项目。

希望它会有所帮助。试试这个:

Go to https://dev.twitter.com/ -> My Applications -> "go to your current application" -> Setting -> Give the permission for "Read, Write and Direct Access" -> Save it. After that uninstall your project from emulator or device, -> Clean project -> Run Project.

Hope it will helpful. try this one:

一紙繁鸢 2024-12-27 00:39:51

此问题应遵循的步骤。

使用

https://dev.twitter.com/apps 登录
然后转到设置

并将权限只读更改为

读取、写入和访问私信

并更新页面。如果万一无法更新,则重新创建令牌并重试问题将得到解决。

Steps to follow for this problem.

Login with

https://dev.twitter.com/apps
and go to settings

and Change the permission Read-only to

Read, Write and Access direct messages

and update page. and if in case not able to update then Re-Create the Token and try again problem will be solved..

—━☆沉默づ 2024-12-27 00:39:51

您的 Twitter 应用程序可能存在问题:
写入权限可能剩余,否则会产生问题:

转到 https://dev.twitter.com/ ->我的应用程序 -> “转到您当前的应用程序”->设置->授予“读、写和直接访问”权限 ->保存起来。之后从模拟器或设备中卸载您的项目,->清洁工程->运行项目。

希望它会有所帮助:

May be issue with your twitter application:
Write Permission may remaining is it creates problem:

Go to https://dev.twitter.com/ -> My Applications -> "go to your current application" -> Setting -> Give the permission for "Read, Write and Direct Access" -> Save it. After that uninstall your project from emulator or device, -> Clean project -> Run Project.

Hope it will helpful:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文