Answer the question
In order to leave comments, you need to log in
What happened to the VK API with attachments?
I do not understand what the problem is, everything seemed to work before.
From the server I send data to wall.post text + picture, the picture was loaded before that, after adding the post is created, the text is there, but the picture is not.
Steps:
1. I take the picture on the server
2. I get a link to the upload form (photos.getWallUploadServer)
3. I upload the picture from the link (from the received link)
4. I save the picture (photos.saveWallPhoto)
In the response I get
{ response:
[ { id: 456XXXXX,
album_id: -14,
owner_id: 578XXXXX,
photo_75: 'https://pp.userapi.com/XXXXX_c.jpg',
photo_130: 'https://pp.userapi.com/XXXXX_c.jpg',
photo_604: 'https://pp.userapi.com/XXXXX_c.jpg',
width: 604,
height: 403,
text: '',
date: 1517946325,
access_key: '8ad26XXXXXXX } ] }
//https://api.vk.com/method/wall.post?owner_id=-XXXXXXXX&from_group=1&access_token=TOKEN&v=5.67
params.request.formData = {
//message: post.text, // Убрал текст, так как с ним все ок
attachments: attachments.join(',') // Так выглядит вложение photo-5XXXXXXX_4XXXXXXX
}
return request.post(params.request).then(e => {
console.log(e.error)
})
{error_code: 100,
error_msg: 'One of the parameters specified was missing or invalid: invalid message param',
request_params:
[ { key: 'oauth', value: '1' },
{ key: 'method', value: 'wall.post' },
{ key: 'owner_id', value: '-2XXXXXX' },
{ key: 'from_group', value: '1' },
{ key: 'v', value: '5.67' },
{ key: 'attachments', value: 'photo-5XXXXXXX_4XXXXXX' } ] }
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