A
A
Albert2017-06-16 16:19:59
PHP
Albert, 2017-06-16 16:19:59

Why can't I send an image using the message.sent method?

Hello! There is a public that should receive an image from one user and send it to another user.
How I get the image:
$user_att_ph= $data->object->attachments[0]->photo->id;
$owner_id_att = $data->object->attachments[0]->photo->owner_id;
$access_key= $data->object->attachments[0]->photo->access_key;
$att_ph = "photo{$owner_id_att}_{$user_att_ph}_{$access_key}";
For example, I get: photo335173286_456239027_c2d826370a3e8a2a49 Everything
seems to be correct
Next, the image is sent:
https://api.vk.com/method/messages.send?user_id=11...
The message is sent("gg"), it does not give any errors, but the image does not attached! What's wrong ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Serezha, 2017-06-16
Ahen @Ahen

There is such. If you call the incoming message using the messages.getById method and use the access key from the received object, then it works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question