i have tried to get facebook group id (gid) by it's url using C#, with no luck.
I have looked over the facebook graph tables, tried PHP, FQL queries, and even tried P3P to get the feed itself of the group page (To get the 'cid' value) - But again - with no luck, I'm getting a token successfully using facebook SDK but I dont understand how to use it to get the group id or the group source code (which always returns the login page), can you help ?
You can fetch the username from the url- string after last /. You can find how to do that. Then simply use the Search API.
You'll be needing a valid user access token with the API call-
/search?q={group-username}&type=group
Example: https://graph.facebook.com/search?q=progressivenagars&type=group&access_token={access-token}
Related
I'm trying to use the Graph SDK to get a specific Sharepoint site by URL so I can read and write the list, create document libraries, and add documents to existing libraries.
This works to get the root:
var site = await graphClient.Sites[SPUrl].Request().GetAsync();
This doesn't work to get the site I want:
var site = await graphClient.Sites[SPUrl+"/segment1/segment2/site"].Request().GetAsync();
And this doesn't work to get the site by URL -- it tells me "the provided path does not exist or does not represent a site":
var siteByPath = await graphClient.Sites[SPUrl].SiteWithPath("/segment1/segement2/site").Request().GetAsync();
But using the Graph Explorer, this works:
https://graph.microsoft.com/v1.0/sites/my.site.com:/sites/segment1/segment2/site?$select=id
Using the Graph Explorer I determined that each segment of the URL is considered its own site, but didn't have any luck doing this -- the error is "provided identifier is malformed - id is not valid":
var site = await graphClient.Sites[SPUrl].Sites["segment1"].Request().GetAsync();
What am I missing?
With the Sharepoint CSOM you could just ask for a site by its URL. My application is in Azure now and being authenticated by through OAuth tokens, not by a username and password handled within the application, so I'm not sure I can pass that authentication through CSOM. As far as I can tell I need to use Graph now.
It would appear that the problem was that if you're going to query the sites under a site root, you need to add the ":" to your original root site string. So
"await graphClient.Sites[SPUrl].Sites["/segment1/segment2/site"].Request().GetAsync();" needs to be
"await graphClient.Sites[SPUrl+":"].Sites["/segment1/segment2/site"].Request().GetAsync();" which would make it match the syntax used in the Graph Explorer.
I had assumed that asking for a Site using the SDK would handle that, but I was wrong.
I am trying to get all the comments and users who commented those.
Using graph API explorer, for a particular page using page access token, I am able to get all the comments for a post and users who commented.
But using facebook App, I am only able to get comments and not the users who commented.
The user has Admin role on that page.
following are the steps I am following :
This returns list of pages and there page access token.
https://graph.facebook.com/me/accounts?access_token=XXXXXXXXXXXX
This returns the list of posts in that page
https://graph.facebook.com/{page-id}/posts?access_token=XXXXXXXXXXXX
This returns the list of comments
https://graph.facebook.com/{post-id}/comments?access_token=XXXXXXXXXXXX
In the last step I am suppose to get user details along with comment.
What am I missing ?
I m trying to fetch feeds by graph API using
https://graph.facebook.com/me/feeds?access_token=xxxxx
I tried with steps for getting short live access token,then using short live access token able to get long live access token
using long live access token i tried to fetch feeds but no data found
so using long live access token ,i tried following code for getting page access token
https://graph.facebook.com/me/accounts?access_token=LongLivedToken
but it i always found blank page access token.
please suggest which token should i pass for getting incoming feed using graph api
I think the problem is with the permission given to the access_token
to get the facebook feed , u need a read_stream permission from facebook, ie a access token with read_stream.
Is there any way we can get posts, status of Facebook to show in our application based on some Keywords or GEO location. I have done it for Twitter using developer account where I used to apply some token keys and gets the result in json format.
Is there any similar way to get posts from Facebook developer account?
You can use the Search API to search based on keywords. Like this:
https://graph.facebook.com/search?q=football&access_token={ACCESS_TOKEN}
To search for objects near a geographical location, use type=location and add the center and distance parameters: /search?type=location¢er=37.76,-122.427&distance=1000
Here's more detail: http://api-portal.anypoint.mulesoft.com/facebook/api/facebook-graph-api/docs/reference/search
Using tweetsharp to pull data for a specific user: I would like to get the numbers of retweet (RT or Retweet) and the numbers of mentioning (#).
Could you help me? Thanks.
The current version of TweetSharp, version 2.0, has methods that map directly to the Twitter API.
Assuming you have the oAuth tokens for a user you can use methods like
.ListRetweetsOfMyTweets(...)
.ListTweetsMentioningMe(...)
If you don't have access to a user's profile, you can still do a search for that user using the standard search query syntax.
.Search("to:JohnDoe" ... )
.Search("from:JohnDoe" ... )
Both should get you the details you're looking for.