Search people on facebook by name and get fields=name, id, education - facebook

I want to create a search engine, it want to search people by name and i needed fields: id, name, education.
Is there possible?
I use this way:
https://graph.facebook.com/search?q=tom&type=user&fields=id,name,education&access_token=XXX
but, in result missing the education info.
{ "data": [
{
"id": "123456789",
"name": "name0"
},
{
"id": "123456789",
"name": "name1"
},
{
"id": "123456789",
"name": "name2"
},
{
"id": "123456789",
"name": "name3"
}, ...

That´s not possible, you can only get the education of users who authorized your App with the user_education_history permission, this would be the API call:
https://graph.facebook.com/me?fields=education

Related

How to delete user by email id using azure SCIM api in databricks?

I need to know if there is a way to delete a user from databricks using email only using SCIM api? As of now I can see it can only delete user by ID which means I need to first retrive the ID of the user and then use it to delete.
I am using this api from powershell to delete users by email.
https://learn.microsoft.com/en-us/azure/databricks/dev-tools/api/latest/scim/scim-users
If you look into the documentation for Get Users command of SCIM Users REST API, you can see that you can specify the filtering condition for it. For example, to find specific user, you can filter on the userName attribute, like this:
GET /api/2.0/preview/scim/v2/Users?filter=userName+eq+example#databricks.com HTTP/1.1
Host: <databricks-instance>
Accept: application/scim+json
Authorization: Bearer dapi48…a6138b
it will return a list of items in the Resources section, from which you can extract user ID that you can use for delete operation:
{
"totalResults": 1,
"startIndex": 1,
"itemsPerPage": 1,
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"Resources": [
{
"id": "8679504224234906",
"userName": "example#databricks.com",
"emails": [
{
"type": "work",
"value": "example#databricks.com",
"primary": true
}
],
"entitlements": [
{
"value": "allow-cluster-create"
},
{
"value": "databricks-sql-access"
},
{
"value": "workspace-access"
}
],
"displayName": "User 1",
"name": {
"familyName": "User",
"givenName": "1"
},
"externalId": "12413",
"active": true,
"groups": [
{
"display": "123",
"type": "direct",
"value": "13223",
"$ref": "Groups/13223"
}
]
}
]
}

Facebook - How to create an URL to fanpage from fanpage name?

I have a fanpage name, for example: "Funny Vines". Real URL of this fanpage is: https://www.facebook.com/funnyvinesofficalpage/
How I can get/create this URL when I have only name of this fanpage ("Funny Vines")?
Thanks.
You can use the Search API:
/search?type=page&q=Funny Vines&fields=name,link
Docs: https://developers.facebook.com/docs/graph-api/using-graph-api#search
Keep in mind that this is a search, so you don´t just get one result, obviously:
{
"data": [
{
"name": "Funny Vines",
"link": "https://www.facebook.com/funnyvinesofficalpage/",
"id": "662605137102011"
},
{
"name": "Funny Vines",
"link": "https://www.facebook.com/FunnyVinesLovers/",
"id": "979586622060309"
},
{
"name": "Iligan Funny Vines and Pictures",
"link": "https://www.facebook.com/Iligan-Funny-Vines-and-Pictures-304142043018984/",
"id": "304142043018984"
},
{
"name": "Funny Vines",
"link": "https://www.facebook.com/vines6/",
"id": "433033710153363"
},
{
"name": "Funny Viral Vines",
"link": "https://www.facebook.com/Funny-Viral-Vines-1375072712767279/",
"id": "1375072712767279"
},
...

Facebook Api: Access detailed education info

I try to get more information about a persons eduaction, but the only result I get for the parameter education is this:
{
"education": [
{
"school": {
"id": "106192892753205",
"name": "Karl-Bosch-Schule"
},
"year": {
"id": "293652345609608",
"name": "2012"
},
"type": "High School"
},
...
How can I get access to the further information like when the person started and finished school? Or their degree?
Thanks
EDIT: Request goes to:
/me?fields=education

Facebook Graph API posts not appearing for users of page, only admin

I created a page on facebook, and am using the graph api to make posts on the timeline. These post show up just fine for me as the admin, but for users the page is empty.
I verified with the graph api explorer. As an admin a GET of /NewsCrier/feed is filled with data.
As a non admin user the same request returns
{
"data": [ ]
}
Here is an example post from the response of my admin user, notice the privacy is set to public:
{
"id": "383422711781035_404880726301900",
"from": {
"category": "Community",
"name": "News Crier",
"id": "383422711781035"
},
"message": "This appears to be the DC shooter, Aaron Alexis",
"picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQD4wR0Y9UVbb4Js&w=154&h=154&url=http%3A%2F%2Fwww.justmugshots.com%2Fimg%2F814064%2Flg%2Faaron-alexis.jpg",
"link": "http://www.justmugshots.com/texas/fort-worth/814064",
"name": "Aaron Alexis, Arrested on 2010-09-04",
"caption": "www.justmugshots.com",
"description": "Aaron Alexis was arrested in Fort Worth, Texas on 2010-09-04. See the mugshot now.",
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
},
{
"name": "Like",
"link": "https://www.facebook.com/383422711781035/posts/404880726301900"
}
],
"privacy": {
"description": "Public",
"value": "EVERYONE",
"friends": "",
"networks": "",
"allow": "",
"deny": ""
},
"type": "link",
"status_type": "shared_story",
"application": {
"name": "Reddit News Alerts",
"id": "693375074022011"
},
"created_time": "2013-09-16T19:36:07+0000",
"updated_time": "2013-09-16T19:36:07+0000"
}
The problem is that your Facebook app is in sandbox mode, as soon as you take the app from sandbox all the users will se the newly created posts ;)

Get more detail from Facebook Notifications?

I'm writing an app that gathers info from a users Facebook notifications. Using the Graph Explorer, I request:
me/notifications?include_read=true
and this returns a bunch of data. Each item is a notification item you would see when logging into Facebook. For example (ID/names changed slightly):
{
"id": "notif_630262196_168132987",
"from": {
"name": "John Bloggs",
"id": "822724665"
},
"to": {
"name": "Dermot Bloggs",
"id": "680265196"
},
"created_time": "2013-01-23T22:58:28+0000",
"updated_time": "2013-01-23T22:58:28+0000",
"title": "John Bloggs commented on your link: \"Goodbye Great Barrier Reef. Goodbye...\"",
"link": "http://www.facebook.com/<removed>/posts/330788937030559?comment_id=1702155",
"application": {
"name": "Links",
"id": "2309869772"
},
"unread": 0,
"object": null
}
The notification is in relation to a comment, but the "title:" field gets truncated if it is too long.
Is there a clean way I can programmatically access the comment directly, so I can get all the text, even if it is a 1000 character comment?
Thanks! :-)
You should be able to get the comment by parsing the link field and querying:
/330788937030559_1702155
or
/POSTID_COMMENTID
When I tested this on my account, I am getting a comments object in the returned data, with the full text of the comments. I've got most permissions enabled in my Graph API. I suspect adding read_stream to the permissions is what will give you this data.
You can avoid parsing! I've been doing a lot of experimentation with notifications and getting what I've called the 'source' object (the source object being the Facebook Graph Object from which the notification originates). Unfortunately, I can't find any documentation on how exactly this mechanism works, but if your app has been granted a lot of permissions, the "object" field which in the JSON you posted is null will actually be populated with the 'source object'. Instead of just "object" : null it will look like this:
"object": {
"id": "587140489_588632201147717",
"from": {
"name": "Dave Rodríguez",
"id": "587140489"
},
"message": ":D ",
"picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-prn1/632550_478955408819349_478954732152750_60483_1892_t.jpg",
"link": "https://www.facebook.com/photo.php?v=478954732152750",
"source": "http://video.ak.fbcdn.net/hvideo-ak-prn1/v/754708_478955348819355_1792301950_n.mp4?oh=c7295ccfc3773f24de931e4c29f512ce&oe=513F1728&__gda__=1363127340_9302c108824176369427a0b17491b800",
"name": "¡¡¡EL SECRETO DE LA CHANCLA!!!!",
"description": "EL SECRETO DE LAS MADRES, EL MÁS UTILIZADO EN TODAS LAS GENERACIONES, VÉALO USTED MISMO Y ((COMPARTA))!",
"properties": [
{
"name": "Length",
"text": "1:13"
}
],
"icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif",
"actions": [
{
"name": "Comment",
"link": "https://www.facebook.com/587140489/posts/588632201147717"
},
{
"name": "Like",
"link": "https://www.facebook.com/587140489/posts/588632201147717"
}
],
"privacy": {
"value": ""
},
"type": "video",
"status_type": "shared_story",
"object_id": "478954732152750",
"application": {
"name": "Video",
"namespace": "video",
"id": "2392950137"
},
"created_time": "2013-03-10T20:45:20+0000",
"updated_time": "2013-03-10T20:45:20+0000",
"likes": {
"data": [
{
"name": "Adrian Guerra Cuenta Verificada",
"id": "674364748"
}
],
"count": 1
},
"comments": {
"count": 0
}
}
I hope somebody more knowledgeable than me can tell us exactly what permissions we need to see this field populated. I'd figure it out myself but there are so many permissions that brute-forcing the SUM(nCk(77,k),k,1,77)=151115727451828646838271 possible combinations of permissions would take a very long time.