R
R
Radist_1012014-11-06 08:36:02
JavaScript
Radist_101, 2014-11-06 08:36:02

How to make a post on the wall in vk.com using wall.post from the site?

All the time I stumble upon the error "open api access error", or the window appears and disappears.
Here is the code that I use using open api:

<button type="button" class="btn btn-primary" onclick="postWall('test message');"></button>

VK.init({
           apiId: ********
});

        function postWall(message) {

            VK.Auth.login(
                function(response) {
                    if (response.session) {
                        var userId = response.session.mid;
                        VK.Api.call('wall.post',
                                {owner_id: userId, message: message}, function (data) {
                                    if (data.response) {
                                        alert('Запись успешно добавлена!');
                                    }
                                });
                    }
                },
                8192
            );

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WebEditor, 2014-11-06
@WebEditor

vk.com/dev/wall.post
vk.com/dev/api_confirm
vk.com/dev/errors

R
Radist_101, 2014-11-06
@Radist_101

but everything seems to be fine, I tested from the local machine, and if you work from the server, then the messages are fasting

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question