0

Can you post a photo to the wall of a friend of the logged-in user using the FB Graph API? I could find no posts that answered this exact question but if there are please point me in the right direction.

I have tried the code found in answers to this question to post a photo, but no matter what user id is used in the call to api, the photo gets added to an album on the logged-in user's profile.

Is it possible to post a photo to another user's profile - just like one any user can manually add to someone's Wall Photos? i.e, a post that will have type: "photo" in the graph API instead of type "link".

Community
  • 1
  • 1
Lack
  • 1,625
  • 1
  • 17
  • 29

1 Answers1

0

Even while going through the old publish documentation, they specify you can only include attachments using links to the media you'd like to attach and not by uploading directly through the API. Looks like this is the route you're going to have to go (using the link property you've already mentioned)

Brad Christie
  • 100,477
  • 16
  • 156
  • 200
  • What I do now is that - add the photo to the current user's album for the application and then post a link to the friend. It's too bad posting directly doesn't work though.. kind of like phoning someone to say you have a postcard for them at your house. – Lack Dec 28 '10 at 02:56
  • So why not avoid that; you're working with PHP, assuming you can live with the bandwidth requirement, point it to a PHP page that renders an image output so that Facebook can grab it and attach it. It appears FB only looks to the link as an upload measure not a linked-resource (like when you paste a link in a comment box, it extracts the data and archives it internally). – Brad Christie Dec 28 '10 at 17:24
  • Ah,my mistake. I misunderstood and thought you were adding it to their personal album (within facebook) then referencing that new entry in the post. As an aside, I'm sure Facebook will smarten up eventually, this seems like too primitive a task to leave out of the API call (although, understandably, they want to limit the bandwidth wherever they can most likely or keep a property-rich API call light). – Brad Christie Dec 28 '10 at 17:52
  • Yes that's all working, but the attached image is just a thumbnail which links to a fullsize. Now I just have a choice between storing all the images on my server to be visible only through the app or posting them to a slightly improper place as a facebook photo, which I can deal with. Thanks for your help. – Lack Dec 28 '10 at 17:59
  • (sorry about writing an incomplete comment!) – Lack Dec 28 '10 at 18:00