L
L
lumino42013-12-03 17:43:28
In contact with
lumino4, 2013-12-03 17:43:28

VK Standalone application API messages.getDialogs?

Tell me, please, what is the problem.
Actions:
Created a Standalone application with id == appID (I'm writing a plugin for Google Chrome).
I send a request to https://oauth.vk.com/authorize with parameters

{"client_id": appID, "display": "page", "scope": "524288", "redirect_uri": "https://oauth.vk.com/blank.html", "response_type": "token"}

After permission from the user, I get a token (let it be ACCESS_TOKEN).
Problem:
from the address bar of the browser, a request of the form:
https://api.vk.com/method/messages.getDialogs?access_token='ACCESS_TOKEN'
gives "error_code":10,"error_msg":"Internal server error: could not get application".
From the application, a request of the same type produces an error in RESPONSE: "Permission to perform this action is denied"

Question:
What are the causes of these two errors?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
sasha, 2013-12-04
@lumino4

Permission to perform this action is denied - [literally] Access to perform this action is denied . keyword THIS. you have scope 524288 which corresponds ONLY to notifications, nothing more. If you want to have notifications and messages, then you need
(524288 + 4096) 528384 , this is how the VK digital scope works.
https://vk.com/dev/permissions
ps: I know how to do a trick with my ears and not ask the user for authorization, just log in when, for example, installing a chrome extension

A
Alexander, 2013-12-03
@alexyat

In theory, VK also asks permission from the user whether it is possible to allow the app to use information and access to the wall, for example (depending on what you pass in settings). You need to emulate this action, or show this window to the user so that he clicks allow.

M
Maxim, 2013-12-03
@maxfarseer

https://api.vk.com/method/messages.getDialogs? - waits after all not only access token? although no parameter is required in the documentation, but try to put at least user.id
Next, you tried to set scope = message - this is a good code, but you can’t be sure that it’s waiting for VK - you can’t be here) then he wants a number (it worked for a web application ), then the list of rights separated by commas (in your case with standalone, maybe here you need to specify something else besides messages). Try playing around with permissions and adding parameters along with the token to getDialogs

G
germn, 2013-12-04
@germn

I got an error when I tried to use a token with a space character at the end. Try trimming the token before using it. Check it for correctness (if there are any extra characters).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question