How to make a comment in facebook with attached picture - facebook

In facebook site you able to make a comment and attach image to it. Is it possible to do the same things with facebook api?
I have read this facebook for dev link and there is no answer to my question.

If you read the documentation properly, it says-
message is the only parameter in this API call. It should be a string containing the comment text.
So, using the API you can just comment a message to the object using-
POST /{object-id}/comments?
message='This is my message'
, no link/picture could be attached alongwith.

I don't know if it is a recent change in the way Facebook handles this, but if I put the complete url in the comment, Facebook detects it as an image and shows it there (along with the url).
Maybe it's not the cleanest way, but it's a way.

Related

facebook graph page/picture edge returning questionmark

So this is a little bit odd, I have a website that trawls facebook looking at specific pages and requesting data from them.
As part of this I request the picture object of the page: http://graph.facebook.com/285361880228/picture
This returns a question mark instead of the page profile picture.
Other links to pages seem to work without a problem.
http://graph.facebook.com/1485760851674064/picture
Does anyone know what may be causing this?
I am currently using version 2.3 of the API.
I'm assuming it has something to do with the page setup, as according to the facebook documentation,I should be able to read this.
https://developers.facebook.com/docs/graph-api/reference/v2.3/page/picture/
It seems like the facebook page has not been published. Try publishing the page and access the image using same link. It will work.

Facebook. Fan page. Wall. Pictures

I have some problems with Facebook Graph API and want to ask some short questions.
Firstly. Is there any method to post multiple images in single wall page post using API? Any method? I want take some photos, text description and say to facebook through API: "I need your wall post with this data". After search I did not find any chance to do it.
Secondary. I can add single photo with description to page wall (edge /{pageID}/photos), but I can not edit through API (edge /{photoID}). Interesting fact - facebook answers to API photo edit call with message "success: true", but nothing happens! Image stays unchanged. Maybe anyone knows why?
Thank you for your future advices and your patience.
You can´t post multiple pictures in one API call, at least not right now.
Are you sure you looked at the right spot? Keep in mind that there will be a picture posted with a caption, but there will also be a wall post. Maybe you have only changed the photo caption and it´s not visible on the wall. Take a look at the picture directly.
That being said, according to the API reference, you should get more than just "OK", you should get the post id in the result. i´d file a bug: https://developers.facebook.com/bugs/

Post object, status_type property doesn't work?

We're able to post to user's FB timeline/page as the page, no problem. The issue is the post that our app is posting is way smaller than post that a page/user can post to the feed manually.
We've tried to change status_type to one of mobile_status_update, created_note, added_photos, added_video, shared_story, created_group, created_event, wall_post, app_created_story, published_story, tagged_in_photo, approved_friend according to the API (https://developers.facebook.com/docs/reference/api/post/) but neither of these change how the post looks in the feed.
Has anyone been able to post content to timeline/page wall through an APP that looks as if it was posted manually - specifically size of the image?
Sample page post that was posted through our app as page owner - image is small:
Sample page post that was posted manually - large image. We'd like the one above to look like this as well when posted through the app:
status_type is set automatically. You can't set it yourself.
In the case of the manual post, you added a photo. To do that in the API, you have to query /PROFILE_ID/photos.
What you did through the API most probably is a post with a link, with the use of /PROFILE_ID/post with the link field filled. Hence, Daniel & Co shared a link.
That's why it doesn't look the same.
Some help for you to succeed at posting a photo:
How-To: Use the Graph API to Upload Photos to a user’s profile
Adding Photos to Stories
Disable grouping of photos on the timeline
Also note that you won't be able to post a photo with the link to image which is hosted on Facebook.

Including a link in a facebook Post from the api

I am using the restfb Java api (from Scala) to post to Facebook. I have two questions.
i) If you put a link in the message field of a post, it will automatically be rendered as a link. But what if you want to include link text instead of the href in the post message? Including Dude gets rendered as a string. But clearly there are many examples of things like "Hey, check out this car , where car is a link. How do you do this?
ii) Facebook is including the description of my company in each post. I set the description field to the empty String and its still showing up. I even removed the description from the settings page for my Facebook app and its still showing up. Any ideas?
Thanks.
Instead of putting the link in the message parameter, you can put it in the link parameter of your HTTP POST to the Graph API. Otherwise, it cannot be done with an inline link that has text (like what you can do with normal href's).
I don't know of a way to remove a description meta tag once it's been set. Try just a period instead of an empty string to see if that works.

Programmatically post an image on a comment at Facebook

I used the Facebook API to post an image or a comment on the wall using an iPhone. But I am trying to post an image on someone's comment through my application. How can we programmatically post an image to someone's post as a comment?
According to the Graph API documentation you can post comments to an object's /comments connection, but the only argument it takes is "message". So, no images.
Normally if you paste a URL to an image in a post, it automatically appears as an image, but I don't think I've ever seen images in comments on posts.
You can try putting it inside <img src="pic-url-goes-here">, but I'm pretty sure that does not work in replies at least.
If it really is impossible, you should (ask to) modify your application's functionality. Uploading the image from the application and linking to it in the comment would at least "get it in there" (as a link).