M
M
Millerish2016-06-17 19:38:07
PHP
Millerish, 2016-06-17 19:38:07

VK api where is the error?

Good evening!
Tell me why there is an error when working with the API.
I received a token, it turns out to check a personal message using it:

' https://api.vk.com/method/messages.get?access_token= ' + AT

But when trying to send a message:
' https://api.vk.com/method/messages.send?access_token= ' + AT + '?user_id=13897175?message=' + str(i)
an error occurs:
{"error":{"error_code":5,"error_msg":"User authorization failed: invalid access_token (4).","request_params":[{"key":"oauth","value":"1" },{"key":"method","value":"messages.send"}]}}

Why is this situation happening? How to write a request correctly?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
S
Sergey Semenko, 2016-06-17
@abler98

Separate GET parameters with &

https://api.vk.com/method/messages.send?access_token=' + AT + '&user_id=13897175&message=' + str(i)

Z
zelsky, 2016-06-17
@zelsky

You've been told what's wronginvalid access_token

D
Danil Biryukov-Romanov, 2016-06-17
@urtow

Try moving the access_token to the very end of the URL

#
#algooptimize #bottize, 2016-06-17
@user004

0 <= count ? <= 1
0 <= count &

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question