Question

Using C# SDK, I'm currently posting photos directly to the Facebook fan page wall.

The current posting path is as follows: "/PageID/photos".

I need to post to a specific album on this page, e.g. "MyAlbum".

How to get the ID of required album by its name, and what path should be used for posting to it?

Was it helpful?

Solution

To retrieve the album id or aid of the required album of the page you may either retrieve list of albums of the page through Graph API endpoint /PageID/albums and navigate to the required album or use the following FQL, which is more efficient than Graph API,

select aid from album where owner=PageID and name="MyAlbum"

This will give the required aid and to create or upload the images in this specific album you can issue an HTTP POST request to

/aid/photos

with publish_stream permission and source, image source, and message parameters. If the create is successful you will get id of the photo created.

Also refer to album documentation for more detail.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top