Graph API Version

User Albums

Albums for a Facebook User.

Reading

The photo albums this person has created

Permissions

  • A user access token is required with the user_photos permission to view a person's albums.

This API can only be used to read albums of the person who created the access token. It can't be used to read the albums of friends or non-friends.

Example

Graph API Explorer
GET /v2.11/{user-id}/albums HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '/{user-id}/albums',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "/{user-id}/albums",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{user-id}/albums",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{user-id}/albums"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Parameters

This endpoint doesn't have any parameters.

Fields

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of Album nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
100Invalid parameter
200Permissions error

Creating

Permissions

  • A user access token is required with the publish_actions and user_photos permission.

Example

You can make a POST request to albums edge from the following paths:
When posting to this edge, an Album will be created.

Parameters

NameDescription
contributors
list<int>

Contributors to turn this into a shared album

description
UTF-8 string

Deprecated. Use the message param

DeprecatedSupports Emoji
is_default
boolean
Default value: false

true indicates that the request will create the application specific album

location
string

A text location of the album for non-page locations

make_shared_album
boolean
Default value: false

Ensures the created album is a shared album

message
string

The album's caption. This appears below the title of the album in the album view

name
UTF-8 string

The title of the album

Supports Emoji
place
place tag

The ID of a location page to tag the album with

privacy
Privacy Parameter

The privacy of the album

tags
list<int>

Deprecated

Deprecated
visible
string

Deprecated. Use privacy

Deprecated

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
200Permissions error
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token
16500Album description is too long.
2010Photos calls have been temporarily disabled for this application

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.