VK API,拒绝访问社区墙上的帖子,失败WALL权限 [英] VK API, access denied for post on wall of a community, fail WALL Permissions

查看:254
本文介绍了VK API,拒绝访问社区墙上的帖子,失败WALL权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VK社区中构建了用于发布的API.但是我检查了我对我的应用程序的权限,并且我拥有所有权限,但没有加载WALL权限.

I build API for post on my community of VK. But I check my permission for my app, and I have all permissions, but not load WALL permissions.

在OAuth的作用域中,我放置了所有作用域,而不使用WALL.我检查了"Api.console",它们具有访问墙-该应用程序可以访问您的墙"的信息,但是在我的应用程序中没有出现.

In the scope for OAuth, I put all scopes and not work the WALL. I check the "Api.console" and they have "Access to Wall - The application has access to your wall", but in my app not appear.

这是响应:

{"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"wall.post"},{"key":"owner_id","value":"-*********"},{"key":"from_group","value":"1"},{"key":"message","value":"New post on group wall via API."}]}}

我检查其他服务,如果可以工作.

I check other services and if work.

推荐答案

您无法调用 (以及许多其他方法)与非独立应用程序.看来您的VK应用程序是网站 iFrame 类型-他们对API方法的访问权限有限.

You can't call wall.post (and a lot of other methods) with a non-standalone applications. It seems like your VK application is of type Website or iFrame - they have limited access to the API methods.

但是,虽然您不能从非独立应用程序中调用此方法,但可以通过 Open API (这是网站应用程序的JavaScript SDK)或 的JavaScript SDK iFrame 应用程序. 当您通过这些SDK调用 wall.post 时,将出现一个确认窗口,用户需要在发送之前确认留言墙:

However, while you can't call this method from non-standalone applications, can via the Open API (it's a JavaScript SDK for Website applications) or the JavaScript SDK for iFrame applications. When you call wall.post via these SDKs, a confirmation window will appear where the user needs to confirm the wall post before sending it:

独立应用程序旨在用于移动或桌面客户端或浏览器扩展之类的应用程序(因为它们没有CORS限制,并且可以读取任何选项卡).如果您试图通过网站授权用户,则绝对没有任何方法可以不受限制地获得用户的独立访问令牌.

Standalone applications are designed to be used in apps like mobile or desktop clients or browser extensions (because they don't have CORS limitations and may read any tab). There is absolutely no ways to get a user's standalone access token without limitations if you are trying to authorize them via website.

如果您正在构建网站或其他内容,并且需要 wall.post 用于服务(例如,新闻交叉发布),那么您可以获取令牌并将其保存在网站配置中的任何位置.打开此地址:

If you are building website or something and need wall.post for service purposes (e.g. news cross-posting), then you may get your token and save it anywhere in site configuration. Open this address:

https://oauth.vk.com/authorize?client_id={APP_ID}&scope={PERMISSIONS}&v={ACTUAL_API_VERSION}&response_type=token&redirect_uri=https://oauth.vk.com/blank.html

  • {APP_ID}-您的独立应用程序ID(可以在应用程序中找到设置).
  • {PERMISSIONS}-权限的逗号分隔列表.不要忘记获得未过期令牌的offline权限.
  • {ACTUAL_API_VERSION}-VK API版本.
    • {APP_ID} - your standalone application ID (may be found in application Settings).
    • {PERMISSIONS} - comma-separated list of permissions. Don't forget the offline permission to get token that doesn't expire.
    • {ACTUAL_API_VERSION} - VK API version.
    • 示例:

       https://oauth.vk.com/authorize?client_id=123456&scope=wall,offline&v=5.60&response_type=token&redirect_uri=https://oauth.vk.com/blank.html
      

      请注意,redirect_uri=https://oauth.vk.com/blank.html是获得令牌的必需条件,而没有上述限制.

      Note that redirect_uri=https://oauth.vk.com/blank.html is required to get token without the above mentioned limitations.

      在您对应用程序进行帐户访问后,无限制的访问令牌将显示在浏览器地址栏中.只需复制它,保存在您的配置中,即可随时调用您想要的任何方法.

      After you grand your application access to your account, access token without limitations will appear in your browser address bar. Just copy it, save in your configs and feel free to call any methods you want.

      这篇关于VK API,拒绝访问社区墙上的帖子,失败WALL权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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