Skip to content

post 'attached_media' array #187

@Art3miX

Description

@Art3miX

I was trying to post a post to Facebook with multiple images, but facebook was giving me error when I was adding attached_media parameter to the ${pageId}/feed, This is how I ended up doing it:

const postData = {
  message:        post.text,
};

images.forEach((imageId, index) => {
  postData[`attached_media[${index}]`] = `{"media_fbid": "${imageId}"}`
});

Looping over all the images, and manually adding attached_media[index] parameter.

It would be nice if we could just add it as an array, like this:

const postData = {
    message:        post.text,
    attached_media: [{"media_fbid": "${imageId1}"}, {"media_fbid": "${imageId2}"}]
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions