S
S
StepanStepanov2018-06-30 18:31:28
API
StepanStepanov, 2018-06-30 18:31:28

How to correctly update an advertising post on the wall through the Vkontakte API without touching the button image?

Good afternoon, I ran into a confusion with the size of button images when editing the title of an advertisement link via the API
In short, the question is:
the URL of the element with what size from the link.photos array of the advertisement received by the wall.getById method to use when filling in the link_image field when editing the advertisement by the wall method. editAdsStealth?
What I'm trying to do:
Update only the title of the link (link_title) via wall.editAdsStealth
How I'm trying to do it:
I take an advertising entry from the wall using the wall.getById method
in wallRecord.attachments.link.photo we see several sizes that can come from the same method of one and the same API version:

album_id: -1
 id : 987654321
 owner_id : 123456789
sizes  {
{type: "e", url: "Ссылка...", width: 50, height: 50}
{type: "a", url: "Ссылка...", width: 200, height: 90}
{type: "d", url: "Ссылка...", width: 100, height: 100}
{type: "b", url: "Ссылка...", width: 400, height: 180}
{type: "c", url: "Ссылка...", width: 200, height: 200}
{type: "l", url: "Ссылка...", width: 534, height: 240}
{type: "o", url: "Ссылка...", width: 581, height: 261}
{type: "k", url: "Ссылка...", width: 1069, height: 480}
 }

or
{type: "s", url: "Ссылка...", width: 75, height: 35}
 {type: "m", url: "Ссылка...", width: 130, height: 70}
 {type: "x", url: "Ссылка...", width: 150, height: 80}
 {type: "p", url: "Ссылка...", width: 260, height: 140}
 {type: "l", url: "Ссылка...", width: 537, height: 240}
 {type: "k", url: "Ссылка...", width: 1069, height: 480}

or
{type: "s", url: "Ссылка...", width: 75, height: 32}
{type: "m", url: "Ссылка...", width: 130, height: 56}
{type: "o", url: "Ссылка...", width: 130, height: 87}
{type: "p", url: "Ссылка...", width: 200, height: 133}
{type: "q", url: "Ссылка...", width: 320, height: 213}
{type: "x", url: "Ссылка...", width: 604, height: 262}
{type: "r", url: "Ссылка...", width: 510, height: 340}
{type: "y", url: "Ссылка...", width: 807, height: 350}
{type: "z", url: "Ссылка...", width: 928, height: 403}

Now we need to decide what size to use:
when using a button image URL of the same size as in the ad, i.e. 200x90, this image is truncated to 150x67
If you use a URL like
https://vk.com/photo%owner_id%_%id%
the button image becomes "empty"
If you use just of
photo%owner_id%_%id%
course we get an error, they say link_image is wrong.
Given that different sizes keep coming in. What size

image link should I use when updating the ad button so that the image doesn't change?

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