To publish a link on your website, use the widget Share
or its simplified version �this type of link https://vk.com/share.php?url
To learn more about using this widget, visit this page
Sharing with friends is possible in several widgets for external websites. If each of these cases, a link to your website where the widget is placed will be attached to the post on the user�s wall:
- Widget comments � a user can share comments on their wall. The parameter autoPublish allows the user to set publishing by default.
- Widget �Like� � the action �Tell friends� creates a post with optional commentary on the user�s page.
- Polls widget � the user can share poll results.
For publishing posts from clients and server apps, use the method wall.post
. You can call it directly by using the classic interaction with API scheme
, from SDK
, from Open API
, if the speech is about the app-website. In Open API and apps on vk.com, actions require user confirmation.
To attach audio, video or photos to a post, pass the type of object and its string identifier in the parameter attachments
Object type � audio
String identifier � this is a string which includes the object�s owner ID (owner_id
) and the ID of the object itself (audio_id
For example, for pictures photo34_408897832
it is necessary to pass the value photo34_408897832
https://api.vk.com/method/wall.post Call the method wall.post to publish the post with the text �Tanya� and the attached photo photo34_408897832 on the community wall ��������� API.
To attach a new object to the wall post, it is necessary to upload it to the VK server. Depending on the type of content, use one of the approaches, which is described on this page
. Then use the uploaded object�s ID in the parameter attachments
With the help of wall.post
, it is possible to work with suggested and postponed posts. In order to create a suggested post, pass the published page ID into �owner_id�, where the current user is not the manager.
To create a postponed post, pass the time of publication into the parameter publish_date
For publishing suggested and postponed posts, use the parameter post_id
, the value of which can be received using the method wall.get
To attach a link snippet from an external website to a post (image preview, title and description), pass the URL in the parameter attachments
. For example, http://yandex.ru
. The snippet is generated automatically. To learn more about this, continue reading the next section.
Link snippets to an external website in a wall post
A snippet for external sites in wall posts, comments or personal messages is generated automatically. Information for this is determined according to these rules:
- Title. If the published page contains the tags og:title, mrc__share_title or twitter:title, then the title will be taken from one of these (whichever is stated first), otherwise the tag <title> will be used.
- Illustrations. If the published page contains the tag vk:image, then the address for the illustration will be taken from it. If no, the tags og:image, twitter:image, image will be checked and the address for the illustration will be taken from whichever is stated first. Otherwise the address will be formed by the first eight tags <img src="...">, and these suggestions are offered for images with a height and width in excess of 160 pixels. If the picture is more than 537 pixels in width, then the link on the website will be followed by an enlarged picture.
An example of a website code which mentions the data for the title, description and image used for VK publications:
<meta property="og:title" content="Title page" />
<meta property="og:image" content="https://pp.vk.me/c629531/v629531034/3172e/xEBYyER1WE4.." />
<meta property="og:description" content="Page description" />
Take note that data for publishing may be cached. If you changed the data on your website, while old data is being displayed on VK, clear the website cache pages.clearCache
For informational resources, we recommend sharing published materials in the section �Articles�
If the link to the article is included in the post, the button �preview� will appear, which redirects to a wiki-version of the article. A user can preview the article�s content without going to an external website. Preview button under the post
To switch on the preview function for links from your website, please contact Support
. In the application, it is necessary to mention links to several examples of the articles, the link to the VK community of your website and data regarding website and community visits.
Open a wiki-version of an article