A
A
Alex2015-01-10 12:23:05
JavaScript
Alex, 2015-01-10 12:23:05

How to get the ID of the current Vkontakte user?

How to get the ID of the user who is currently authorized in VK without using access_token? (For standalone applications).

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
Max Payne, 2015-01-16
@Kozack

If standalone - then no way, but if it opens a frame application - you can.

T
Testtest132, 2015-01-10
@Testtest132

If you open the VK documentation, you can pay attention to:

When displaying an application using flashVars or a query string (for IFrame applications), the following parameters are passed to it:
api_url is the address of the API service to which requests should be made.
api_id is the id of the running application.
user_id is the id of the user from whose page the application was launched. If the application is not launched from the user's page, then the value is 0.
sid - session id for making requests to the API
secret - The secret required to sign requests to the API
group_id is the id of the group from the page of which the application was launched. If the application is not launched from the group page, then the value is 0.
viewer_idis the id of the user who is viewing the application.
and others - read more here

If you have a website, authorization is required either based on OAuth 2.0 or Open API

V
velezh, 2015-05-15
@velezh

You need to execute users.get with a single access_token parameter. There, among other things, there will be uid.

A
Alexander Aksentiev, 2015-01-10
@Sanasol

Are you talking about this habrahabr.ru/post/228617/?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question