M
M
MUTOgen4eg2013-07-20 18:08:07
PHP
MUTOgen4eg, 2013-07-20 18:08:07

vk API. Wall post?

I've run into a problem that I can't find a solution to.
There is a site. The admin (and only the admin) must have the function to post in vk through his vk-account on the wall of his group information by clicking on the button.
That is a kind of transmission.
All attempts to launch an api call with an access_token obtained as a result of authorization results in

Permission to perform this action is denied for non-standalone applications: you should request token using blank.html page

How to be in such a situation? If you redirect to VKontakte's blank.html, then how to pull out the token in a two-way pass?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
U
UZER2006, 2013-07-20
@UZER2006

Apparently you are doing something wrong. I advise you, in the best traditions of windows, to reboot and try again.
1. wall.post is available only to standalone applications (or web when using the confirmation box). The application type (seems) does not change and is set at the creation stage.
2. Accordingly, wall.post is allowed only for the token received through blank.html (in other cases, the request for wall rights is simply ignored)
The link to receive has the form https://oauth.vk.com/authorize?client_id=<app_id>&scope=...,wall,...&redirect_uri=https://oauth.vk.com/blank.html&response_type=token
To reduce problems, you can add the offline parameter to the scope - the received token will be “eternal” ( in fact, it will live until the application is deleted or the VK password is changed).
3. As a result, the call to send a message looks likehttps://api.vk.com/method/wall.post?owner_id=<id группы или пользователя>&message=<текст сообщения>&access_token=<ранее полученный токен>
In principle, if the post is made by user action, then if nothing happens, you can use JavaScript VK.api and post with a confirmation window.

M
Maxim Timokhin, 2013-07-20
@timokhin

The token in this case is manually copied after the redirect and stored somewhere in the config or in the database and used in requests.

V
Vladislav Onishchenko, 2013-07-20
@STFBEE

The use of wall.post only by the admin is regulated on the site itself, and the token gives the script full control (but subject to application permissions) over the account from which this token was received. I advise you to read the instructions for obtaining a token more accurately, since I myself took a long time and skipped some steps, believing that I was doing everything right;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question