Profile archive album

From Facebook Developer Wiki

Jump to: navigation, search

The profile archive album is a pseudo-album. The photos are accessible via photos.getAlbums, by specifying the parameter aid=-3. This album appears on a user's Photos tab, called Profile Pictures, but does not appear in a user's list of albums.

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.

If you prefer to calculate the Platform aid rather than get it from photos.getAlbums, you can do the following:

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


For example, 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).

Notes

The given PHP function is useless since it is never safe to assume the PHP script will be run 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';
reference