Profile Picture
GET v24.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
}];| Field | Description |
|---|---|
bottomunsigned int32 | Deprecated Deprecated |
cache_keystring | A key to identify the profile picture for the purpose of invalidating the image cache |
heightunsigned int32 | Picture height in pixels. Only returned when specified as a modifier |
is_silhouettebool | True if the profile picture is the default 'silhouette' picture |
leftunsigned int32 | Deprecated Deprecated |
rightunsigned int32 | Deprecated Deprecated |
topunsigned int32 | Deprecated Deprecated |
urlstring | URL of the profile picture. The URL will expire. |
widthunsigned int32 | Picture width in pixels. Only returned when specified as a modifier |
picture edge from the following paths: | Parameter | Description |
|---|---|
android_key_hashstring | Android key hash for the proxied app ID. |
burn_media_effectboolean | burn_media_effect |
captionUTF-8 string | The caption for a profile pic Supports Emoji |
composer_session_idstring | Composer session ID |
frame_entrypointstring | frame_entrypoint |
has_umgboolean | Whether or not the picture uploaded has edits made in the unified media gallery |
heightint64 | Height for crop |
ios_bundle_idstring | iOS bundle ID for the proxied app ID. |
media_effect_idslist<int> | Set of Media Effect IDs that were used on this pic |
media_effect_source_object_idint | The FBID of the media from which the effects were sourced. |
msqrd_mask_idstring | MSQRD mask ID that was used to create this pic Deprecated |
photonumeric string | ID of the photo to use as the profile pic |
pictureURL | URL of the picture to upload |
profile_pic_methodstring | Method of the profile pic change for logging |
profile_pic_sourcestring | Source of the profile pic change for logging |
proxied_app_idint | ID of the proxied app that performed this action |
qnstring | Waterfall logger session ID |
reuseboolean | Whether to reuse an existing profile pic |
scaled_crop_rectObject | Dictionary with fractional (scaled) keys x/y/width/height for crop |
set_profile_photo_shieldstring | Whether to set Women in Emerging Markets Profile Photo Safety Shield on or off |
sticker_idint | Sticker ID for profile pics with sticker overlays |
sticker_source_object_idint | The FBID of the source media |
suppress_storiesboolean | suppress_stories |
widthint64 | Width for crop |
xint64 | Top-left x-coordinate for crop |
yint64 | Top-left y-coordinate for crop |
success: bool, | Error | Description |
|---|---|
| 368 | The action attempted has been deemed abusive or is otherwise disallowed |
| 240 | Desktop applications cannot call this function for other users |
| 200 | Permissions error |
| 324 | Missing or invalid image file |
| 190 | Invalid OAuth 2.0 Access Token |