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

6.5k views Asked by At

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.

2

There are 2 answers

7
Petr Flaks On

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.

0
Uriahs Victor On

Late but...for this you need to first create a sort of "demo" app for VK using the standalone app type which would issue you an access token inside the address bar when you set the redirect link to https://oauth.vk.com/blank.html

This access token would allow you to share to your personal profile wall.

Then you need to contact VK support and display your app in action. Once they approve it then you'd be able to use a "Website" app that has OAuth style authentication