我正在尝试实现VK API,所以感谢OAuth代码,我得到一个令牌,只需添加此范围offline,audio
,现在执行此请求:
https://api.vk.com/method/account.getInfo?access_token=XXXXX&v=5.62
并以此回报:
{
"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"
}
]
}
}
为什么,这也是一个范围?
您的应用程序不是独立类型,或者您没有通过Implicit Flow方案获得访问令牌。
注意:您应该设置参数redirect_uri=https://oauth.vk.com/blank.html
以获得无限制的访问令牌。在其他方面,访问令牌将仅限于仅适用于独立应用程序的调用方法。
您还需要在授权方法中放置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”);