// 3. Запостим в группу
$attachment = '{
"media": [
{
"type": "text",
"text": "1234"
},
{
"type": "photo",
"list": [
{
"id": "'.$token.'"
}
]
}
]
}';
$params = array(
"application_key" => $ok_public_key,
"method" => "mediatopic.post",
"gid" => $ok_group_id,
"type" => "GROUP_THEME",
"attachment" => $attachment,
"format" => "json",
);
// Подпишем
$sig = md5( arInStr($params) . md5("{$ok_access_token}{$ok_private_key}") );
$params['access_token'] = $ok_access_token;
$params['sig'] = $sig;
$step3 = json_decode( getUrl("https://api.ok.ru/fb.do", "POST", $params, 30, false, false ), true);
print_r($step3);
// Если ошибка
if (isset($step3['error_code'])) {
// Обработка ошибки
echo "ошибка";
print_r($step3);
}
$step3 = json_decode( getUrl("https://api.ok.ru/fb.do", "POST", $params), true);