Graph:Album

From Facebook Developer Wiki (FbDevWiki.com)
Jump to: navigation, search

A photo album

Contents

Example

https://graph.facebook.com/99394368305 (Coca-Cola fan page wall photos)

Properties

Name Description Permissions Returns Condition
id The photo album ID Publicly available A JSON string
from The profile that created this album Publicly available A JSON object containing the id and name fields. Also contains category if owner is a page.
name The title of the album Publicly available A JSON string
description The description of the album Available to everyone in Facebook A JSON string
location The location of the album Available to everyone on Facebook A JSON string
link A link to this album on Facebook Publicly available A JSON string containing a valid URL
privacy The privacy settings for the album Available to everyone on Facebook seems to only be album user A JSON string Doesn't seem to have a value even when directly queried with fields=privacy. Does have a value if owned by the current user session.
count The number of photos in this album Publicly available A JSON integer
created_time The time the photo album was initially created Publicly available A JSON string containing a IETF RFC 3339 datetime
updated_time The last time the photo album was updated Publicly available A JSON string containing a IETF RFC 3339 datetime
type The type of photo album. Can be one of:
  • profile: The album containing profile pictures
  • mobile: The album containing mobile upload photos
  • wall: The album containing photos posted to a user's Wall
  • normal: For all other albums.
is overwritten when using metadata=1
comments same content as comments connection Publicly available
picture same content as picture connection, but in JSON format Publicly available only available when fields=picture
photos same content as photos connection Publicly available only available when fields=photos
likes same content as likes connection Publicly available only available when fields=likes
cover_photo cover photo of album Publicly available id of a Photo object if available

Connections

Name Description Permissions Returns
photos The photos contained in this album Publicly available JSON object containing data and paging. The data portion contains an array of Photo objects.
comments The comments made on this album Publicly available JSON object containing data and paging. The data portion contains an array of Comment objects.
picture The album's cover photo Publicly available An HTTP 302 with the URL of the album's cover picture
likes The likes made on this album Publicly available JSON object containing data and paging. The data portion contains an array of objects containing id and name fields.

Publishing

Requires the publish_stream permission.

To create a new, empty photo album, POST the album name and optional description/message to http://graph.facebook.com/PROFILE_ID/albums.

Check out the Photo documentation for more information about publishing photos to albums.

curl -F 'access_token=...' \
     -F 'name=My new photo album' \
     -F 'message=My photo album description' \
     -F 'visible=....' \
     https://graph.facebook.com/me/albums

Where values for visible (album permissions) are: friends, friends-of-friends, networks, everyone

Notes/Bugs/Gotchas

When creating an album the description parameter must be named "message", not "description" as you might guess from the docs. (bug 14976)

Why can't I create an album on a page?
Using a user's token and posting to /PROFILE_ID/albums might create an album for that user, not the specified PROFILE_ID. You must use a token obtained with the manage_pages permission.
Why can I only get 25 photos?
the default limit is 25. If you want to get from 25-50 just use albumid/photos?limit=25&offset=25. If you want 50-70 use albumid/photos?limit=20&offset=50, etc.
Why is the album I created not shown on the user's wall?
Facebook will not show empty albums in the user's photos. The album will be visible when you first upload a photo in that album.
Personal tools
Namespaces
Variants
Actions
Navigation
Graph API
FQL
Toolbox