Answer the question
In order to leave comments, you need to log in
VK API attachments link how to specify link preview?
Hello everyone)
I am publishing a post to the group on Vkontakte:
$arPicture = CFile::GetPath($arFields["DETAIL_PICTURE"]);
$URLPicture = "https://". $_SERVER['SERVER_NAME'] . $arPicture);
$link = $arFields['CANONICAL_PAGE_URL'];
// Отправляем сообщение.
$params = array(
'v' => '5.52',
'access_token' => $access_token,
'owner_id' => '-' . $group_id,
'from_group' => '1',
'message' => $message,
'attachments' => $link
);
$result = file_get_contents('https://api.vk.com/method/wall.post?' . http_build_query($params));
$result = json_decode($result);
$VK_ID = $result->response->post_id;
print_r($VK_ID);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question