Facebook - How to post feed on company page using custom name - facebook

I am able to successfully post content to Company Page using the Facebook Graph API.
I have a query to know how to pass Personal Name or Company Name while posting the content.
I am referring to URL: https://developers.facebook.com/docs/graph-api/reference/page/feed/ to post the content but didnt find out parameter for passing Personal Name/Company Name.
Please reply me as soon as possible.
Thanks,
Chirag

Related

trying to find page ID from page URL like https://www.facebook.com/profile.php?id=XXXXXX

I have URLs like this: https://www.facebook.com/profile.php?id=XXXXXX where XXXXXX is an ID, but not a page ID and I need to find the page ID from it.
I've tried requesting https://graph.facebook.com/XXXXXX?access_token=YYYY (where YYYY is an access token that have Page Public Content Access permission), but answer is Unsupported get request. Object with ID 'XXXXXX' does not exist...."
I found that Page ID is available in page source code of the web page, but Facebook disallow scrapping of their pages.
here are some examples:
https://www.facebook.com/profile.php?id=100063722132763 => Page ID: 815246995503983
https://www.facebook.com/profile.php?id=100063578267534 => Page ID: 330810097560194
So, if anyone know a way to find this Page ID from the URL using graph API (or any other way authorized by Facebook), I would be very thankfull!
Thank you,
Dan
I find page ID in this way.
example page : https://www.facebook.com/profile.php?id=100063722132763
I will keep 100063722132763 in front and find a post in this page.
post example : https://www.facebook.com/permalink.php?story_fbid=pfbid01Focai6WiaWM6DR7oHaTQBmU7x9qzibJ5gjzfbsCTe9xqwjdQu2SiApP17BED1MEl&id=100063722132763
Combine 100063722132763 with story_fbid in pattern like this 100063722132763_pfbid01Focai6WiaWM6DR7oHaTQBmU7x9qzibJ5gjzfbsCTe9xqwjdQu2SiApP17BED1MEl and send in graph API you will get the postID with real page ID
I got a problem same as you. I hope anyone can find a easier way to solve this problem.

Get URL (Link) for facebook post using post ID

I am trying to get a post from a company Facebook page.The link is for an application i developed that feeds of information from another applications database that uses the Facebook API.
i want to create a link eg www.facebook.com/{postID} that will take me to the specific post.I have tried numerous articles and all seem to send me to a 404 page. Please help.
Thanks
My Application uses the facebook api that accepts data related to a facebook page content (i.e posts,photo's,statuses etc).part of the api is that it saves the actual post id pertaining to a post for e.g. 302961133120433_576487772434433 into my applications database.As you may see that the post id has 2 parts separated by an underscore.So i needed to make a url based on this post id.
Solution for the link is:(2 parts of it,first being page id and second being actual post id)
Hope this helps.
You have facebook API doc on post here : https://developers.facebook.com/docs/graph-api/reference/v2.8/post
the URL you want is called "permalink_url" as field name, so the API call to get that link is in this format:
URL = 'https://graph.facebook.com/v2.8/' + postId + '?fields=permalink_url&access_token=' + facebookToken
Here is a screenshot for my testing in FB API explorer.
If you want to get a list of posts on IDs on a particular page, it doesnt seem to be documented but this works:
https://graph.facebook.com/teapartypatriots?fields=posts.id&access_token=<TOKEN>
If anyone only needs to redirect to the post URL, just put the post id after https://www.facebook.com/ and it will be automatically taken to the post.
more information from the official docs https://developers.facebook.com/docs/pages/publishing/

Post via open graph to Company Page NOT user

As I am learning and getting familiar with the FB OG API I am finding that I am lacking some of the basics. For example I see here that I use the action type news.publishes to post an article. However the access_token is for the user owning the page and thus it will go to their news feed and not the page (in this case their company page). Correct?
If I understand correctly then how does one get it to post to a specific page. Is there an access_token collection you iterate through till you find the one for the company page?
TIA
JB
You should be able to use /PAGE_ID/feed? Where page id is the numerical assigned by facebook..or the text friendly name you used.

Get all pictures and related comments from a Facebook Group page

I need to get all picture and their related comments which has been made to a particular facebook group page. How can I achieve this through facebook api?
Sure, you just need to make a request to graph.facebook.com/GROUP_ID/feed
Example here: https://developers.facebook.com/tools/explorer?method=GET&path=173972555961507%2Ffeed
The Graph API is really easy to figure out. You have the base url (graph.facebook.com) and then you can make requests to any object on facebook (user, page, group, checkin, etc) by just calling graph.facebook.com/OBJECT_ID. It's all on the front page: https://developers.facebook.com/docs/reference/api/

How to find a post when all you know is the post_id?

I have a simple app for submitting data and after submission I have a share option.
When a user actually shares something he is redirected by Facebook to a specified URI.
Facebook also provides the post_id by appending it to the URI (like http://my-redirected-URL?post_id=100001175803635_321643121201516).
So, without asking anything from the user, I can tell if he shared information or not, and I have his post_id (but not his user_id or name).
But how can I see what he actually wrote? I have his post_id. Where can I look?
I've tried the open graph but with no luck.
I thought this was an answer: what is the url to a facebook open graph post id?, also no luck.
Any ideas?
If you have user access_token for user who shared the content you can issue GET request to Graph API to get the data by post id (100001175803635_321643121201516 for example):
GET https://graph.facebook.com/POST_ID?access_token=USER_ACCESS_TOKEN
Response is the Post object which will have non empty message property if user added some text to shared content...