M
M
Maxim Master2016-01-13 13:44:19
PHP
Maxim Master, 2016-01-13 13:44:19

How to do wall posting with attachments via VK API?

There was a question of publishing posts on the wall with a link attachment with detailed parameters
in the documentation there is a list of types of objects
5cc388ab6149453c864b2beb1456558e.pngfor the attachments field;
f8cfa4c552f4431eb572d19428c4e754.pngfor links of the "link" type, we are offered to write a URL in the attachments field.
By publishing a post through the VK website, we have the opportunity to select our illustration (image_src)
7fb2be7b4d224d15a5bcf368117e5a55.png278c984c50b6496e861e759171fa08cd.pngThat's all further stored in this form

[attachments] => Array
                        (
                            [0] => Array
                                (
                                    [type] => link
                                    [link] => Array
                                        (
                                            [url] => https://toster.ru/
                                            [title] => Интересные вопросы Toster.ru
                                            [description] => Интересные вопросы сервиса вопросов и ответов по IT-тематике Toster.ru.
                                            [image_src] => https://pp.vk.me/c628625/v628625104/3ed90/UbEZrt5i-UM.jpg
                                        )

                                )

                        )

There is also information about media attachments in wall posts, returned as an attachment array.
There remains an incomprehensible situation, is it possible to pass a link to the attachments parameter as an object with its own parameters?
also interested in the question of how to attach a link to a point on the map through the same wall.post
[geo] => Array
                        (
                            [type] => point
                            [coordinates] => 64.093033560641 110.39065416323
                            [place] => Array
                                (
                                    [pid] => 0
                                    [title] => Мирнинский район, Россия
                                    [latitude] => 0
                                    [longitude] => 0
                                    [created] => 0
                                    [icon] => https://vk.com/images/places/place.png
                                    [type] => 0
                                    [address] => 
                                    [place_id] => 0
                                    [country] => Россия
                                    [city] => Мирнинский район
                                )

                            [showmap] => 1
                        )

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question