Get the uploaded photo from Graph API [closed]
I developing a process to upload a photo to a users account with the graph api. While I am successful with being able upload the photo. I unable to retrieve the same said photo that was uploaded just 2 seconds ago. Using a user's access_token I get "false". Using an Ap开发者_JAVA技巧plication's access token i get
"A user access token is required to request this resource"
How are you suppose to retrieve the url of the photo that you just uploaded with the graph api
When you upload the photo, it should return an ID. Use that ID to access it. Also, you may have to wait until that photo has finished processing. Try the call again in a few minutes after the photo has been uploaded.
$data = $facebook->api('/'. $ALBUM_ID . '/photos', 'post', $args);
$data['id']
is the id of the image you just uploaded.
turns out I had to update my SDKs
Seems as if sometimes you can't access the photo without getting an access token with the "user_photos"
permission. Sometimes, as in, for some users you don't need it, and for some you do. Most excellent.
EDIT: actually, this only seemed to work in the graph API explorer and not the iOS app. At least they're consistent.
精彩评论