The task of posting text with a picture to the Vkontakte group is simple with the PHP script, especially since the Vkontakte API is considered to be understandable and reliable. However, I was not able to find on the Internet a clear step-by-step guide for beginners, which would contain ready-made answers to all the small questions that arise along the way.

To begin, you must be logged in to an account that has the right to add posts to the group.
')
Create an application
First of all, you need
to create a standalone application. You must have a VC account for this with an associated phone number. In my practice, if the account does not have an associated phone number, the contact starts to respond very quickly to the API with errors asking to enter the captcha)) that is, you will need to also put the captcha operator next to the script.
Generate access token
Next, we need access token for authorization in the API. To generate it, you need to follow a special link.
https://oauth.vk.com/authorize?client_id=12343547&scope=groups,wall,offline,photos&redirect_uri=https://oauth.vk.com/blank.html&display=page&v=5.21&response_type=token , where the client_id parameter is the identifier previously created application. The scope parameter wraps the set of rights that you award the application. Read more about the rights in the
documentation . After clicking on the link, you need to confirm the transfer of rights to the application and copy the access token directly from the URL, despite the warning of the contact.
Please do not copy the data from the address bar for third-party sites. This way you can lose access to your account . The token generated in this way will be enough to work with the group for an unlimited time.
We write some code
Solving this problem, I tried to find a ready-made library, I found
this one , and as a result I got a
fork , which is used in the example below. For code quality experts: this library is intended solely for demonstration purposes, it does not have extensive functionality, tests, good documentation, performance optimization, cross-platform (php 5.4 is needed) and other things - all this is left to the tireless reader to implement.
So, we post the text with a picture and tags to the Vkontakte community:
The result of executing this code with my token. If you look at the code, then interaction with the VKontakte API takes place strictly according to the
documentation . Thanks for attention!