Graph API 版本

相簿

代表相簿。

讀取

GET /{album-id}

獲取相簿上的欄位和關係連線。

必要條件

必要條件取決於包含相簿的節點類型。

必要條件用戶節點專頁節點群組節點

存取憑證

任何

任何

用戶

功能

無

如要取得你無法執行任務的專頁之公開專頁內容,你需要 Page Public Content Access

無

權限

user_photos

未發佈的專頁:

已發佈的專頁:

無

群組角色

不適用

不適用

管理員

要求語法

Graph API 測試工具
GET /v26.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

代表相簿中的一系列相片。

建立

你無法在此端點上執行此操作。

更新

你無法在此端點上執行此操作。

刪除

你無法在此端點上執行此操作。