fbsamples / workplace-platform-samples

Sample code to enable Workplace customers to make the most of the features of the Workplace Custom Integrations platform.
Other
182 stars 170 forks source link

The /attachments edge not returning attachments #165

Open djmrky opened 3 weeks ago

djmrky commented 3 weeks ago

Hi, I have a strange issue.

I have 2 workplace posts in the same group, one next to another and they both contain some images. The API returns images as attachments for one post, but not for the other one.

What could be the reason for that?

Thanks

NewAlexandria commented 3 weeks ago

Is there any chance that the one with no attachments had its content pasted as rich media, and it's actually HTML that links to an external image?

djmrky commented 3 weeks ago

All my Workplace posts are returning as MARKDOWN text, not HTML, there are no embedded images The post that does not return the attachments on the "/attachments" edge looks like this:

image

And the post that returns the attachemtns correctly looks like this: image

The only difference I've found is the "type" attribute On the one that fails, the type is "album" and the one that returns the attahcments has "photo" for the "type" atrribute.

But I have no idea is there another endpoint to get this "album". The Workplace group has the "/albums" edge, but nothing is returned there for my group The message itself does not have the "/albums" edge

djmrky commented 3 weeks ago

Ok, I've actually found a reason why the images from the post are not returned by the API.

If I create a post and just copy/paste some images (not file upload), they show up as Attachments in the API.

However, if I use this option image

and choose a picture from file, this does not come back in the /attachments edge.

I have no idea how to get this image url via the API, this is not documented at all