M
M
mishadsadsadasdsx2018-05-11 21:24:15
In contact with
mishadsadsadasdsx, 2018-05-11 21:24:15

Why does VK api return an error Error 5: User authorization failed: no access_token passed?

https://api.vk.com/method/friends.get?user_id=babegone

{"error":{"error_code":5,"error_msg":"User authorization failed: no access_token passed.","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"friends.get"},{"key":"user_id","value":"babegone"}]}}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Sokolov, 2018-05-12
@sergiks

It is worth familiarizing yourself with the VKontakte API in their article.
Your error message unequivocally indicates its cause: User authorization failed: no access_token passed.- do not authorize the user making the request due to the lack of an access_token (access key).
To execute friends.get() , you need a key ("access_token") or a service key - from the settings of the VK Application you created; or user - received as a result of the user authorization dialog.
It has also become mandatory to indicate the API version used, the v. Now the current version 5.74
To just try, create an application of type standaloneand copy the Service Key value from its Settings:

screen
5af6a32ecd7c0965325530.png

As a result, your request will look something like this:
https://api.vk.com/method/friends.get?user_id=babegone&v=5.74&access_token=supersecretsupersecret

M
mindgrow, 2018-05-11
@mindgrow

Authorization token not specified

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question