I decided to try myself in vk api, decided to use Python, wrote a simple code:

import vk session = vk.AuthSession(app_id= 'мой_айди', access_token='мой_токен') vk_api = vk.API(session) vk_api.wall.post(message="Hello World!!! I am the first message by python app with vk api :)", v='5.74') 

But the error returned indicated that I had no rights

 vk.exceptions.VkAPIError: 15. Access denied: no access to call this method. 

I decided to create a new token, I start to create, I added the right to work with messages, and he said that my application is not "desktop" and you have no right to it.

 {"error":"invalid_scope","error_description":"Only desktop applications have access to user messages"} 

How to solve this problem?

  • Add the following to vk.AuthSession : scope='wall' - Pavel Durmanov
  • @Alban Added, the result did not give, the same error - Learpcs

1 answer 1

After an hour of torment and searching, I found a solution.

Since I have a problem with access with a key, I decided to find the problem in it, and in support of VC I found a detailed description of the return value of 15 and finally found something meaningful. In particular

Also note that wall permissions are ignored during server authorization.

And I started to google on this topic, and found a wonderful article , I will highlight certain points:

  1. OpenApi - let's try calling the wall.post method.

Attention, this access right is not available for sites (ignored when trying to authorize)

As a result, there was a request to create an entry on the wall

  1. OAuth 2.0 (I used it)

Authorization passes without problems, many API methods work.

But when calling the wall.post method, the API server returns an error:

Permission to perform this action for non-standalone applications

Conclusion : OAuth 2.0 is not suitable for sending messages to the user's wall.

I will try to use OpenAPI, I will write about the result

  • 3
    You just need to take and make the Standalone / Desktop application vk.com/editapp?act=create - OAuth has absolutely nothing to do with it and through it wall.post also works (but only for Desktop applications, of course) - andreymal
  • @andreymal I was absolutely convinced that I created the standalone application, I am grateful for the help in finding the error. - Learpcs