facebook GraphAPI post with Profile picture link
using the Graph API I try to create a post - including a users picture. In the documentation I found: - you can get the elem开发者_如何转开发ents picture with http://graph.facebook.com/XXXXXXX/picture - where XXXX is the id of the object (user).
And ...image src='http://graph.facebook.com/XXXXXXX/picture'... works fine.
My problem now - I try to create a post via ...me/feed passing this link as picture parameter. When I do this - I get an error calling the graph API. If I use a static link (to an existing image) posting works fine.
My goal is to use the users profile picture in the post. Is this (passing a picture to "feed") only possible with static images? Or is there a way to use the http://graph.facebook.com/XXXXXXX/picture link (and I make just a mistake somewhere else)?
Manfred
It should work fine as what the GRAPH API does is it gives you a static URL to the profile image. So, what's the exact error you get ?
the error message tells you the problem. you cannot use it because:
{"error":{"type":"OAuthException","message":"(#100) FBCDN image is not allowed in stream: http:\/\/graph.facebook.com\/215958041750734\/picture"}}
FBCDN means "FaceBook Content Delivery Network", so it wouldn't matter if you use the ID/picture URL or the end URL; they won't allow it by policy. Why the policy? No clue. And it's not likely they'll tell you, judging by their lack of response on their developer's discussion boards.
精彩评论