VK API, access denied for post on wall of a community, fail WALL Permissions

断了今生、忘了曾经 提交于 2019-12-24 02:38:04

问题


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.

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.

This is the response:

{"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.


回答1:


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.

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:

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.

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} - 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.

Example:

 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

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.



来源:https://stackoverflow.com/questions/41494966/vk-api-access-denied-for-post-on-wall-of-a-community-fail-wall-permissions

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!