Graph API 版本

Profile Picture Source

閱讀中

Profile Picture

新版專頁體驗

This endpoint is supported for 新版專頁體驗.

例子

Graph API Explorer
GET v19.0/...?fields={fieldname_of_type_ProfilePictureSource} 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(
    '...?fields={fieldname_of_type_ProfilePictureSource}',
    '{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(
    "...?fields={fieldname_of_type_ProfilePictureSource}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "...?fields={fieldname_of_type_ProfilePictureSource}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"...?fields={fieldname_of_type_ProfilePictureSource}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果想了解如何使用 Graph API,請參閱我們的使用 Graph API 指南

參數

這個端點沒有任何參數。

欄位

欄位描述
bottom
unsigned int32

Deprecated

已停用
cache_key
string

A key to identify the profile picture for the purpose of invalidating the image cache

height
unsigned int32

Picture height in pixels. Only returned when specified as a modifier

is_silhouette
bool

True if the profile picture is the default 'silhouette' picture

left
unsigned int32

Deprecated

已停用
right
unsigned int32

Deprecated

已停用
top
unsigned int32

Deprecated

已停用
url
string

URL of the profile picture. The URL will expire.

width
unsigned int32

Picture width in pixels. Only returned when specified as a modifier

建立中

You can make a POST request to picture edge from the following paths:
發佈到此關係連線時,會建立 a ProfilePictureSource

參數

參數描述
android_key_hash
string

Android key hash for the proxied app ID.

burn_media_effect
boolean

burn_media_effect

caption
UTF-8 string

The caption for a profile pic

支援表情符號
composer_session_id
string

Composer session ID

frame_entrypoint
string

frame_entrypoint

has_umg
boolean

Whether or not the picture uploaded has edits made in the unified media gallery

height
int64

Height for crop

ios_bundle_id
string

iOS bundle ID for the proxied app ID.

media_effect_ids
list<int>

Set of Media Effect IDs that were used on this pic

media_effect_source_object_id
int

The FBID of the media from which the effects were sourced.

msqrd_mask_id
string

MSQRD mask ID that was used to create this pic

Deprecated
photo
numeric string

ID of the photo to use as the profile pic

picture
URL

URL of the picture to upload

profile_pic_method
string

Method of the profile pic change for logging

profile_pic_source
string

Source of the profile pic change for logging

proxied_app_id
int

ID of the proxied app that performed this action

qn
string

Waterfall logger session ID

reuse
boolean

Whether to reuse an existing profile pic

scaled_crop_rect
Object

Dictionary with fractional (scaled) keys x/y/width/height for crop

x
float

y
float

width
float

height
float

set_profile_photo_shield
string

Whether to set Women in Emerging Markets Profile Photo Safety Shield on or off

sticker_id
int

Sticker ID for profile pics with sticker overlays

sticker_source_object_id
int

The FBID of the source media

suppress_stories
boolean

suppress_stories

width
int64

Width for crop

x
int64

Top-left x-coordinate for crop

y
int64

Top-left y-coordinate for crop

傳回類型

Struct {
success: bool,
}

Error Codes

錯誤說明
368The action attempted has been deemed abusive or is otherwise disallowed
240Desktop applications cannot call this function for other users
332The image you tried to upload is too small. Please try again with a larger image.
200Permissions error
100Invalid parameter
210User not visible
324Missing or invalid image file

更新中

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

正在刪除

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