Current, I can upload a photo to an user's album. but I can't use the url of this photo(assemble the url by the photo id), it says:"FBCDN image is not allowed in stream", I also figured out that facebook forbid user to do this.
I know that I can upload the photo to somewhere else on the internet, but actually I don't have that 'somewhere', so how does everybody do ?
You dont need to assemble the url of the picture you just uploaded. Instead, use the photo_id that you got back and make another call to the Graph api :
https://graph.facebook.com/{PHOTO_ID}
The response from that call will contain all the information you need (including a link to the photo on facebook).
Related
I try to use this picture url when I share post to the Facebook wall
https://fbcdn-photos-e-a.akamaihd.net/hphotos-ak-prn2/t1/1509934_1399389213653861_1680466495_a.jpg.
But I get an error, which says: "An unknown error has occurred.". It's very strange, because when I try to use this picture url:
http://zastavki-oboi.ru/thumbs/oranjevyi_cvetochek-4636.jpg
I do not get any errors.
I really do not understand, why first one does not work, but second one works correctly!
Any ideas?
You probably want to post to the /feed edge with an object_attachment specified. The object_attachment being the Facebook object ID of the image you want to share. The app user will also need to be the owner of that photo.
object_attachment
Facebook ID for an existing picture in the person's photo albums to
use as the thumbnail image. They must be the owner of the photo, and
the photo cannot be part of a message attachment.
See under Publishing: https://developers.facebook.com/docs/graph-api/reference/user/feed/#
And a note, if you only have the url of the image, the object ID should be the middle set of numbers in the filename. 1509934_1399389213653861_1680466495_a.jpg.
I've read the documentation here.
I have an action, "cook", which is applied to an object "recipe". I want to allow the user to post a photo of their cooking when they perform the action.
I would like to have the photo hosted on Facebook. Is there any way to post the actual image data as part of the request, rather than posting a URL to the user generated photo?
The docs say
The photo used will NOT be taken from the object's meta data og:image tag. Instead, it is passed with the POST
and
The photo will be uploaded and placed in a Facebook photo album titled after the "App Display Name" for that app
but they also mention that the image[0][url] property is required.
The context is an iOS app: the user takes a photo on the device and wishes to post it to Facebook. To get a URL to the image, I'd obviously have to do an upload to some web hosting somewhere as a separate step, which would be harder to code and would require some hosting.
but they also mention that the image[0][url] property is required.
You’ll have to upload the photo first to some place where it’s available over the web via HTTP, and then give that URL while posting your action.
I have a Facebook application in which a user can upload photos to a facebook fanpage. I am having trouble figuring out how to upload the photo as the user that is using the application. Currently I can have the fanpage upload the photo as itself, so the fanpage loses the author of the photo.
To do this I am grabbing the fan page's auth token(which I am assuming is the reason the app is posting as the fan page) and using that to pass to the "photos" method of the api. I am using the AS3 api, but I am sure the concept is the same no matter which api I am using.
var values:Object = {message:"message here", name:"title here"};
values.access_token = fanPageAccessToken;
values.image = file;
Facebook.api('fanPageId/photos/', handleUploadComplete, values,'POST');
When I change to the user's access token the image is uploaded to the user's photos. Even though I am specifying the fanPageId, it gets uploaded to the user's photos.
I am struggling here. Does anyone have an idea I can try, or some insight to share?
Thank you so much, I appreciate your time!
I've tried every possible API combination to post a photo to a page from the user, but it's no use. A user cannot post a photo to a page. Even creating an album on the page and then posting to that doesn't work.
I'm trying to post a picture to a feed using the graph API but this does not work if my image url does not have an image filename extension such as .png
(I have a URL to a png without the .png file extension as the image is created dynamically on the server)
This does seem to work when I manually post the link on my Facebook wall. Facebook wraps the URL like this:
http://external.ak.fbcdn.net/safe_image.php?d=AQAsdfyQsdfXvV5h59OP&w=90&h=90&url="my image url"
Does anyone know how I can post the URL of an image to the picture field of a feed post?
Facebook downloads and caches any image posted on the wall. It is then distributed on their CDN (content delivery network).
The reason is simple: load times. If someone posts an image from a slow server on FB, this could make experience of Facebook slow. So they copy all that.
So
maybe Facebook still has an old copy. Try with a fresh URL.
can facebook access the URL, or only your user?
Is there any way to upload an image (UIImage) directly from an iPhone app to a user's wall/feed?
All the samples I see are either using a json-embedded link or they use the photos.upload call with album ID (aid) which results in the user getting the image in his photo album(s).
What I want to do is to upload an (UI)Image created (by the user) inside an iPhone app and upload to his/her wall. Is this possible? Sample code would be highly appreciated.
This isn't possible. To understand why, you have to consider the conceptual model that Facebook currently uses: Posts on a user's wall are just bits of text optionally attached to some link URL. That link URL can be some random image on the web, or it can just as well be an image that the user already has in their photo albums.
But a wall post cannot inherently "contain" an image in and of itself. Therefore you need to host the image somewhere, be it on your own site, or on Facebook itself, inside one of the user's albums by uploading it first to there.
I'm trying to figure out the same thing myself. One thing I did find out is that if you post the "Wall Photos" album they do get posted to the wall. However you only have a wall photos album if you've uploaded photos to your wall from your profile page before. And even then, you need to get the album aid and then post to it.
EDIT
Found a much better solution. First upload the photo to your default album, then make a post to the wall with the link to your photo that was returned when uploading (not a link to the image but the page the image is on).