GET /v21.0/{album-id}/photos 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}/photos',
'{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}/photos",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{album-id}/photos",
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}/photos"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
由此關係連線進行的閱讀將回傳 JSON 格式結果:
{ "
data
": [], "paging
": {} }
data
paging
錯誤 | 說明 |
---|---|
190 | Invalid OAuth 2.0 Access Token |
104 | Incorrect signature |
200 | Permissions error |
100 | Invalid parameter |
80001 | There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
Animated photos are not supported, and a photo must be less than 10MB in size.
photos
edge from the following paths: 參數 | 描述 |
---|---|
aid string | Legacy album ID. Deprecated |
allow_spherical_photo boolean | 預設值: false Indicates that we should allow this photo to be treated as a spherical photo. This will not change the behavior unless the server is able to interpret the photo as spherical, such as via Photosphere XMP metadata. Regular non-spherical photos will still be treated as regular photos even if this parameter is true. |
alt_text_custom string | Accessible alternative description for an image |
android_key_hash string | Android key hash |
application_id non-empty string | iTunes App ID. This is used by the native Share dialog that's part of iOS |
attempt int64 | 預設值: 0 Number of attempts that have been made to upload this photo |
audience_exp boolean | 預設值: false Audience exp |
backdated_time datetime/timestamp | A user-specified creation time for this photo |
backdated_time_granularity enum{year, month, day, hour, min, none} | 預設值: none Use only the part of the |
caption string | The description of the photo |
composer_session_id string | Composer session ID |
direct_share_status int64 | The status to allow sponsor directly boost the post. |
feed_targeting feed target | Object that controls News Feed targeting for this post. Anyone in these groups will be more likely to see this post. People not in these groups will be less likely to see this post, but may still see it anyway. Any of the targeting fields shown here can be used, but none are required. |
filter_type int64 | 預設值: -1 Unused? |
full_res_is_coming_later boolean | 預設值: false Full res is coming later |
initial_view_heading_override_degrees int64 | Manually specify the initial view heading in degrees from 0 to 360. This overrides any value present in the photo embedded metadata or provided in the spherical_metadata parameter |
initial_view_pitch_override_degrees int64 | Manually specify the initial view pitch in degrees from -90 to 90. This overrides any value present in the photo embedded metadata or provided in the spherical_metadata parameter |
initial_view_vertical_fov_override_degrees int64 | Manually specify the initial view vertical FOV in degrees from 60 to 120. This overrides any value present in the photo embedded metadata or provided in the spherical_metadata parameter |
ios_bundle_id string | iOS Bundle ID |
is_explicit_location boolean | Is this an explicit location? |
is_explicit_place boolean | If set to |
manual_privacy boolean | 預設值: false Manual privacy |
message string | Deprecated. Please use the caption param instead. |
name string | Deprecated. Please use the caption param instead. |
no_story boolean | If set to |
offline_id int64 | 預設值: 0 Offline ID |
og_action_type_id numeric string | The Open Graph action type |
og_icon_id numeric string | The Open Graph icon |
og_object_id OG object ID or URL string | The Open Graph object ID |
og_phrase string | The Open Graph phrase |
og_set_profile_badge boolean | 預設值: false Flag to set if the post should create a profile badge |
og_suggestion_mechanism string | The Open Graph suggestion |
place place tag | Page ID of a place associated with the photo |
privacy Privacy Parameter | Determines the privacy settings of the photo. If not supplied, this defaults to the privacy level granted to the app in the Login dialog. This field cannot be used to set a more open privacy setting than the one granted |
profile_id int | Deprecated. Use Deprecated |
proxied_app_id numeric string or integer | Proxied app ID |
published boolean | 預設值: true Set to |
qn string | Photos waterfall ID |
spherical_metadata JSON object | A set of params describing an uploaded spherical photo. This field is not required; if it is not present we will try to generate spherical metadata from the metadata embedded in the image. If it is present, it takes precedence over any embedded metadata. Please click to the left to expand this list and see more information on each parameter. See also the Google Photo Sphere spec for more info on the meaning of the params: https://developers.google.com/streetview/spherical-metadata |
sponsor_id numeric string or integer | Facebook Page id that is tagged as sponsor in the photo post |
sponsor_relationship int64 | Sponsor Relationship, such as Presented By or Paid PartnershipWith |
tags list<Object> | Tags on this photo |
target_id int | Don't use this. Specifying a |
targeting target | Allows you to target posts to specific audiences. Applies to Pages only |
time_since_original_post int64 | Same as |
uid int | Deprecated |
unpublished_content_type enum {SCHEDULED, SCHEDULED_RECURRING, DRAFT, ADS_POST, INLINE_CREATED, PUBLISHED, REVIEWABLE_BRANDED_CONTENT} | Content type of the unpublished content type |
url string | The URL of a photo that is already uploaded to the Internet. You must specify this or a file attachment |
user_selected_tags boolean | 預設值: false User selected tags |
vault_image_id numeric string or integer | A vault image ID to use for a photo. You can use only one of |
id
的節點。id
: numeric string, post_id
: token with structure: Post ID, 錯誤 | 說明 |
---|---|
190 | Invalid OAuth 2.0 Access Token |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
321 | Album is full |
200 | Permissions error |
220 | Album or albums not visible |
100 | Invalid parameter |
324 | Missing or invalid image file |