图谱 API 版

Album

表示相册

读取

GET /{album-id}

获取相册的字段连线

要求

具体要求取决于相册所在节点的类型。

要求用户节点公共主页节点小组节点

访问口令

均可

均可

用户

功能

如果您无法在特定公共主页中执行任务,要获取该公共主页的公开公共主页内容,您将需要 Page Public Content Access

权限

user_photos

未发布的公共主页:

已发布的公共主页:

小组身份

不适用

不适用

管理员

请求语法

图谱 API 探索工具
GET /v19.0/{album-id} 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(
    '/{album-id}',
    '{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(
    "/{album-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{album-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{album-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

字段

名称 描述 类型

id

相册编号。

string

can_upload

浏览者是否可以向此相册上传照片。

boolean

count

相册中照片的大致数量。此数量不一定是精确的计数

int

cover_photo

相册封面照片的编号。

Photo

created_time

相册的初始创建时间。

datetime

description

有关相册的描述。

string

event

与此相册关联的活动。

Event

from

如果相册由当前用户创建,则为当前用户。

User

link

Facebook 上这个相册的链接。

string

location

相册的文本位置。

string

name

相册的标题。

string

place

与此相册关联的地点。

Page

privacy

相册的隐私设置。

string

type

相册的类型。

enum{app, cover, profile, mobile, wall, normal, album}

updated_time

上一次更新相册的时间。

datetime

连线

您可以请求以下连线用作路径参数,或使用 fields 查询字符串参数。

连线 描述

photos

代表相册中的一系列照片

创建

您无法在此端点上执行此操作。

更新

您无法在此端点上执行此操作。

删除

您无法在此端点上执行此操作。