使用OAuth的Vkontakte API不适用于验证码 [英] Vkontakte API using OAuth does not work with Captcha

查看:119
本文介绍了使用OAuth的Vkontakte API不适用于验证码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Vkontakte API拒绝验证码请求. 此处是我的示例.

Vkontakte API rejects requests with Captcha. Here is the example what I do.

在第三个请求之后,我得到:

After the third request I get:

验证码错误(14)-需要验证码.

Captcha error (14) - Captcha needed.

根据文档captcha_sidcaptcha_key参数添加到原始请求并重复该请求就足够了.

According to documentation it's sufficient to add captcha_sid and captcha_key parameters to the original requests and repeat the request.

但是响应仍然是Captcha error (14).可以在Vkontakte API中使用Captcha和OAuth吗?

But the response is still Captcha error (14). Is it possible to work with Captcha and OAuth in Vkontakte API?

推荐答案

验证码错误

错误代码:14

Error code: 14

错误文字:需要验证码

并在以下情况下需要验证码确认:

and captcha confirmation is required, when:

操作(例如发送消息)执行得太频繁,API请求可能会返回"所需的验证码",错误.之后,用户需要输入图片中的代码,然后使用在请求参数中输入的验证码重新发送请求.

action (e.g. sending a message) is performed too frequently, an API request may return "Captcha needed" error. After that a user needs to enter a code from the image and resend a request with a Captcha code input in the request parameters.

更多信息,请参见其手册中的.

More information can be found in their manual.

如果遇到此错误,则需要另外处理带有错误消息的响应中的以下参数:

If this error encounters, you need to process additionaly the following parameters from the response with the error message:

  1. captcha_sid –验证码标识符;
  2. captcha_img –指向将显示给用户的图像的链接.
  1. captcha_sid – captcha identifier;
  2. captcha_img – a link to an image that will be shown to a user.

当用户从captcha_img输入文本时,您必须重新发送请求并添加以下参数:

When user enters text from captcha_img you have to re-send the request adding following parameters:

  1. captcha_sid –收到的ID;
  2. captcha_key –您从用户那里得到的文本输入.
  1. captcha_sid – received ID;
  2. captcha_key – text input you've gotten from user.

请不要忘记也提供有效的访问令牌,以进行用户授权,否则该请求将因另一种错误而被拒绝.

Do not forget to provide the valid access token as well, to make the user authorization, or the request would be declined with another type of error.

这篇关于使用OAuth的Vkontakte API不适用于验证码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆