Profile archive album

From Facebook Developers Wiki

Jump to: navigation, search

The profile archive album is a pseudo-album. The photos are accessible via the API, but the album does not show up in a call to photos.getAlbums(). This corresponds to the behavior of the albums page on Facebook. Your profile photos album doesn't live in your Photos section, it lives with your profile picture.

On Facebook, there are uids and aids. In the Facebook API, an "aid" corresponds to the two of these combined.

The profile archive album for any user has Facebook aid -3. You can construct the Platform aid for the album as follows:

api_merge_aid($aid, $uid):  ($uid << 32) + ($aid & 0xFFFFFFFF)

i.e., if your userid is 548871286:

php> =api_merge_aid(-3, 548871286)
2357384227378429949

You can then use that merged aid to retrieve these photos via a call to photos.get(aid).

[edit] Notes

The given PHP function is useless since it is never safe to assume the PHP script will be ran on a 64 bit machine. You'll probably want to completely rewrite it. The unfortunate part is that PHP is missing any kind of 64-bit support on 32-bit machines. You can thank the crappyness of PHP for that. One very lovely hack you can do is use your SQL server for the calculation. For example:

SELECT (aaaaaaaaa << 32) + (-3 & 0xffffffff) AS 'aaaaaaaaa';