secure.sendNotification - incorrect signature
Добавлено: 02 июн 2011, 16:16
Народ, выручайте. Уже пол-дня ищу багу. Код:
Возвращает 4 Incorrect signature, хотя подпись вроде верно составил.
Код: Выделить всё
$message = $subject.' | '.$text.' | Читать полностью: '.$link; $message = urlencode($message); //requesting api $api_id = "id_приложения"; $api_key = "защищенный_ключ"; $timestamp = strtotime('now'); $rand = rand(0,100000000); $sig = md5("api_id=".$api_id."message=".$message."method=secure.sendNotificationrandom=".$rand."timestamp=".$timestamp."uids=".$idline."v=2.0".$api_key); $postvars = "api_id=".$api_id."&message=".$message."&method=secure.sendNotification&random=".$rand."×tamp=".$timestamp."&uids=".$idline."&v=2.0&sig=".$sig; $chp = curl_init('http://api.vk.com/api.php'); curl_setopt($chp, CURLOPT_HEADER,0); curl_setopt($chp, CURLOPT_RETURNTRANSFER ,1); curl_setopt($chp, CURLOPT_POST, 1); curl_setopt($chp, CURLOPT_POSTFIELDS, $postvars); $res = curl_exec($chp); curl_close($chp);