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
Pageuser_photos permission if it belongs to a Userfriends_photos permission if it belongs to a User's friendIf 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.
An album on the Facebook Page:
https://graph.facebook.com/10150146071791729
The Album object has the following fields.
| Name | Description | Permissions | Returns |
id | The album ID | Any valid |
|
from | The profile that created this album | Any valid | object containing |
name | The title of the album | Any valid |
|
description | The description of the album | Any valid |
|
location | The location of the album | Any valid |
|
link | A link to this album on Facebook | Any valid |
|
cover_photo | The album cover photo ID | Any valid |
|
privacy | The privacy settings for the album | Any valid |
|
count | The number of photos in this album | Any valid |
|
type | The type of the album: | Any valid |
|
created_time | The time the photo album was initially created | Any valid |
|
updated_time | The last time the photo album was updated | Any valid |
|
can_upload | Determines whether the UID can upload to the album and returns | Any valid |
|
The Album object has the following connections.
| Name | Description | Permissions | Returns |
| photos | The photos contained in this album | Any valid | array of |
| likes | The likes made on this album | Any valid | array of objects containing |
| comments | The comments made on this album | Any valid | array of objects containing |
| picture | The album's cover photo, the first picture uploaded to an album becomes the cover photo for the album. | Any valid | HTTP 302 redirect to URL of the album's cover picture |
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 |
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 |
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 |
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 |
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-To: Use the Graph API to Upload Photos to a user’s profile (php)