D
D
Denis99992018-09-04 00:10:05
API
Denis9999, 2018-09-04 00:10:05

Error when requesting api vk?

You need to execute the following method in VK api:
link to the description of the method
To get the service access key, execute the following post request:

$url = 'https://oauth.vk.com/access_token?client_id=6681637&client_secret=мой_ключ&v=5.84&grant_type=client_credentials';

Executed successfully, in response:
(
    [access_token] => 84e7dade84e7dade845ec0a47884822efb884e784e7dadedf6a458d2a70dfa1b02e190b
    [expires_in] => 0
)

But further when executing the query:
$url = 'https://api.vk.com/method/board.getComments?group_id=92037658&topic_id=92037658_37188346&access_token='.$access_token;

The response comes with an error:
[error_code] => 28
            [error_msg] => Application authorization failed: access_token has expired.

The token has expired, how come if the requests are running almost at the same time?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question