简体   繁体   English

拒绝访问:无法调用此方法

[英]Access denied: no access to call this method

I'm trying to implement VK API, so thanks OAuth code I get a token and just add this scope offline,audio and now doing this request: 我正在尝试实现VK API,所以感谢OAuth代码,我得到一个令牌,只是将此范围offline,audio和现在执行此请求:

https://api.vk.com/method/account.getInfo?access_token=XXXXX&v=5.62 https://api.vk.com/method/account.getInfo?access_token=XXXXX&v=5.62

And go this in return: 并以此回报:

  {
  "error": {
    "error_code": 15,
    "error_msg": "Access denied: no access to call this method",
    "request_params": [
      {
        "key": "oauth",
        "value": "1"
      },
      {
        "key": "method",
        "value": "account.getInfo"
      },
      {
        "key": "v",
        "value": "5.62"
      }
    ]
  }
}

Why, there's a scope for this too? 为什么,这也是一个范围?

Your application isn't Standalone type or you received access token not via Implicit Flow scheme. 您的应用程序不是独立类型,或者您未通过隐式流方案收到访问令牌。

Note: you should set parameter redirect_uri=https://oauth.vk.com/blank.html to get access token without limitations. 注意:您应该设置参数redirect_uri=https://oauth.vk.com/blank.html以获取无限制的访问令牌。 In other ways access token will be limited to call methods which available only for standalone applications. 在其他方面,访问令牌将仅限于仅适用于独立应用程序的调用方法。

you also need to place scope=messages in authorization method 您还需要在授权方法中放置scope = messages

GetToken.Navigate(" https://oauth.vk.com/authorize?client_id= "+ VkAPI.__APPID + "&display=page&redirect_uri= https://oauth.vk.com/blank.html&scope=messages&response_type=token&v=5.87&revoke=1 "); GetToken.Navigate(“ https://oauth.vk.com/authorize?client_id= ”+ VkAPI .__ APPID +“&display = page&redirect_uri = https://oauth.vk.com/blank.html&scope=messages&response_type=token&v=5.87&revoke = 1 “);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM