D
D
Dmitry Afonchenko2015-10-20 02:37:43
In contact with
Dmitry Afonchenko, 2015-10-20 02:37:43

Why is the hashtag not being attached in the wall.post method in the VK API?

Good day to all, comrades. The next question was on the agenda.
The wall.post method works when I just post, but if I try to add a hashtag, the VK API returns an error.
For example, I send a message:
https://api.vk.com/method/wall.post?owner_id={my id}message={TEST MESSAGE
#hashtag}&access_token={token}
Response:
{"error":{"error_code ":5,"error_msg":"User authorization failed: no access_token passed.","request_params":[{"key":"oauth","value":"1"},{"key":"method" ,"value":"wall.post"},{"key":"owner_id","value":"17315390"},{"key":"message",
"value":"TEST MESSAGE \r\n"}]}} Although if you just send the same message, without the hashtag, everything works. What could be the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Gromadchuk, 2015-10-20
@Indermove

It is best to pass POST parameters with a request, but if you still want to pass GET parameters with a request, then you need to decode special characters from the message so that they do not violate the integrity of the link.

M
Maxim Master, 2016-01-13
@maximca89

Encode text, php example:
$message = urlencode($message);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question