U
U
Uniq2016-05-19 12:21:46
PHP
Uniq, 2016-05-19 12:21:46

SIG vkontakte how to get?

I'm trying to send a request via noHttps to VKontakte, in writing I need to generate a sig for an hour, I'm struggling, I don't understand
what I'm doing wrong?
vk returns: User authorization failed: sig param is incorrect

$access_token = "xxxx";
$group_id = "xxxx";
$text = urlencode($data["#hello drugs!"]);
$secret="xxx";
$post = "wall.post?owner_id=-".$group_id."friends_only=0from_group=1message=".$text."signed=0access_token=".$access_token."v=5.52".$secret;
$sig = md5($post);
$sRequest = "https://api.vk.com/method/wall.post?owner_id=-".$group_id."&friends_only=0&from_group=1&message=".$text."&signed=0&access_token=".$access_token."&v=5.52&sig=".$sig;
var_dump($sRequest);
$oResponce = json_decode(file_get_contents($sRequest));
var_dump($oResponce);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Gromadchuk, 2016-05-19
@padonnak

1. You didn't read the no http documentation carefully .
If you still read the documentation, you can clearly see that the query string looks like this:
Your $post variable is far from the same type as indicated in the documentation.
2. This whole question was about how to make a request over http , but in your code example you are still making a request over https , where is the logic?

Y
Yakov Vylegzhanin, 2016-05-19
@vylegzhanin

Is this setting even necessary?
I don't see it in the documentation for this method.
https://new.vk.com/dev/wall.post

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question