Facebook Developers
DocsToolsSupportNewsApps
Log In
  • Social Plugins
  • Facebook Login
  • Open Graph
  • Facebook APIs
    • Graph API
    • FQL
    • Open Graph
    • Dialogs
    • Chat
    • Internationalization
    • Ads
  • Games
  • Media
  • Payments
  • App Center
  • Promote Your App
  • iOS
  • Android
  • Web
  • Technology Partners
  • Objects
    • Achievement(Instance)
    • Album
    • App and Game Groups
    • Application
    • Checkin
    • Comment
    • Data Access - Login, Privacy and Permissions
    • Domain
    • Errors
    • Event
    • Field Expansion
    • FriendList
    • Group
    • Insights
    • Link
    • Message
    • Note
    • Offer
    • Order
    • Page
    • Pagination
    • Payment
    • Photo
    • Pictures
    • Post
    • Privacy Parameter
    • Publishing
    • Question
    • QuestionOption
    • Realtime Updates
    • Review
    • Search
    • Selecting Results
    • Status message
    • Thread
    • User
    • Video

Album

Facebook APIs › Graph API › Album

An album of photos as represented in the Graph API.

The User, Page and Application objects have an albums connection of type album.

To read an Album you need

  • Any valid access token if it is public and belongs to a Page
  • The user_photos permission if it belongs to a User
  • The friends_photos permission if it belongs to a User's friend

If an app lets a user choose an album when uploading photos, the app should check the can_upload flag to be sure that the app is allowed to add new photos to the album.

Example

An album on the Facebook Page:

https://graph.facebook.com/10150146071791729

Fields

The Album object has the following fields.

NameDescriptionPermissionsReturns
id

The album ID

Any valid access_token or user_photos or friends_photos

string

from

The profile that created this album

Any valid access_token

object containing id and name fields

name

The title of the album

Any valid access_token or user_photos or friends_photos

string

description

The description of the album

Any valid access_token or user_photos or friends_photos

string

location

The location of the album

Any valid access_token or user_photos or friends_photos

string

link

A link to this album on Facebook

Any valid access_token or user_photos or friends_photos

string containing a valid URL

cover_photo

The album cover photo ID

Any valid access_token or user_photos or friends_photos

string

privacy

The privacy settings for the album

Any valid access_token or user_photos or friends_photos

string

count

The number of photos in this album

Any valid access_token or user_photos or friends_photos

string

type

The type of the album: profile, mobile, wall, normal or album

Any valid access_token or user_photos or friends_photos

string

created_time

The time the photo album was initially created

Any valid access_token or user_photos or friends_photos

string containing ISO-8601 date-time

updated_time

The last time the photo album was updated

Any valid access_token or user_photos or friends_photos

string containing ISO-8601 date-time

can_upload

Determines whether the UID can upload to the album and returns true if the user owns the album, the album is not full, and the app can add photos to the album

Any valid access_token or user_photos or friends_photos

boolean

Connections

The Album object has the following connections.

NameDescriptionPermissionsReturns
photos

The photos contained in this album

Any valid access_token or user_photos or friends_photos

array of photo objects

likes

The likes made on this album

Any valid access_token or user_photos or friends_photos

array of objects containing id and name fields.

comments

The comments made on this album

Any valid access_token or user_photos or friends_photos

array of objects containing id, from, message and created_time fields.

picture

The album's cover photo, the first picture uploaded to an album becomes the cover photo for the album.

Any valid access_token or user_photos or friends_photos

HTTP 302 redirect to URL of the album's cover picture


photos

Create

You can add photos to an album by issuing an HTTP POST request to ALBUM_ID/photos with the publish_stream permissions and the following parameters.

Parameter Description Type Required
source Photo content multipart/form-data yes
message Photo description string no

If the create is successful, you get the following return.

Name Description Type
id The new photo ID string

album

Create

You can create an empty album of a page by issuing an HTTP Post request to PAGE_ID/albums with following parameters.

Parameter Description Type Required
name The name of the album string yes
message The description of the album string yes

If the create is successful, you get the following return.

Name Description Type
id The new album ID string

comments

Create

You can comment on an Album by issuing an HTTP POST request to ALBUM_ID/comments with the publish_stream permission and following parameters.

Parameter Description Type Required
message Comment text string yes

If the create is successful, you get the following return.

Name Description Type
id The new comment ID string

likes

Create

You can like an Album by issuing an HTTP POST request to ALBUM_ID/likes with the publish_stream permission. No parameters necessary.

If the create is successful, you get the following return.

Description Type
If the create succeeded. boolean

Delete

You can unlike an album by issuing an HTTP DELETE request to ALBUM_ID/likes with the publish_stream permission.

If the delete is successful, you get the following return.

Description Type
If the unlike succeeded boolean

How-Tos

How-To: Use the Graph API to Upload Photos to a user’s profile (php)

Updated about a month ago
Facebook © 2013 · English (US)
AboutAdvertisingCareersPlatform PoliciesPrivacy Policy