iOS sort facebook friends who are using one particular application from my friend list - ios

I have one query in fetching out some particular friends from my friend list.
I had created one iOS application in which user can login via facebook. Now I want to get the list of from "my friend" list, who are using that application. Does any particular API call to fetch this particular list? Please advise me on it. Thanks in advance.

Simply fetch the Graph API by your app token :
https://graph.facebook.com/user_id/friends?fields=id,name,installed
if one of your friend installed the same app,the result:
{
"id": "100001410850231",
"installed": true,
"name": "name"
}
if not installed:
{
"id": "100002862380104",
"name": "name"
}

Related

Microsoft Graph translateExchangeIds not returning the same id as EWS

I am working with both EWS and the Graph API.
I would like to create events (online meetings with skype/teams) in an calendar that is already available via EWS.
To match the calendar to the one available via Graph API i try to use https://learn.microsoft.com/en-us/graph/api/user-translateexchangeids
The calendar i created has this id when returned by the FindFolder call:
<t:FolderId Id="AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA=" ChangeKey="..."/>
<t:DisplayName>Test</t:DisplayName>
I create a request to the graph api:
{
"inputIds": [
"AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA="
],
"sourceIdType": "ewsId",
"targetIdType": "restId"}
and get the result
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.convertIdResult)",
"value": [
{
"sourceId": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA=",
"targetId": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgAuAAAAAABW2gY0kRG1SqggDTNZN6i8AQAPJkKZ1XJkQ6huFmcVa6XaAAGixNZ3AAA="
}
]
}
However, if i call https://graph.microsoft.com/v1.0/me/calendars i get a different id
"id": "AAMkAGNiY2YxMjY3LTUxYjgtNGI1Yy1hOTM2LTU4MTM5OTZiNjdjYgBGAAAAAABW2gY0kRG1SqggDTNZN6i8BwBIq5JjIBY-RqWQllrF0GSkAAAAB353AAAPJkKZ1XJkQ6huFmcVa6XaAAGixNowAAA=",
"name": "Test",
Is there a way to match the (ews) calendar i already have to the one returned by the Graph API?
This is a shot in the dark, because I've never dug this deeply into the weeds on the Graph Ids, but you might try calling Graph with the header that selects "immutable ids." I tried to find some details on what this actually means without much luck.
The header is:
request.Header("Prefer", "IdType=\"ImmutableId\"");
HTH, and if not, sorry for guessing.

Sort people by their phone number Microsoft Graph API

I'm trying to get people by their mobilePhone number with graph api in dotnet.
I can I actually get all people who have a mobilePhone defined ?
the object for phones is :
"phones": [
{
"type": "business",
"value": "....."
}
{
"type": "mobilePhone",
"value":"0672737473"
}
]
As you can see it is in an array. I would like to get all people who have the mobile Phone number because business does not concerns my app.
I could get all contacts with paging but I would prefer not having to sort users on my side.
Thanks.
The mobilePhone doesnot support filtering, it is correctly suggested by #Allen Wu.
You can find the details in this documentation

Check if twitter account has been deactivated?

I'm using the twitter4j API and I want to see if, given the ID of a user's account, if that account has been deactivated.
You need to use users/show. It will give you an error code if the user has been suspended.
For example
https://api.twitter.com/1.1/users/show.json?screen_name=nero
Returns
{
"errors": [
{
"code": 63,
"message": "User has been suspended."
}
]
}
If you only have the ID, you can make a similar call - https://api.twitter.com/1.1/users/show.json?user_id=.....
With Twitter4J you use showUser and pass it either the string of the username, or the int of the user ID.
As far as I know there is no dedicated method to do this but using users/lookup (in your case this method) with the user ids you are getting back the the active users only. So if some id is missing from the response those users are the suspended ones.

Get Recommendation from LinkedIn API returns empty map [:] as response

I have created a web application from which I am trying to get recommendations of a user from his/her LinkedIn Profile using URL
String url="https://api.linkedin.com/v1/people/~:(recommendations-received:(id,recommendation-type,recommendation-text,recommender))?format=json"
When I am using this URL in the
Api Explorer it works fine. And gives output:-
{ "recommendationsReceived": {
"_total": 2,
"values": [
{
"id": 558598601,
"recommendationText": "xxx is among the best team players I ever worked with. He has handled client effectively with smooth operations. I had always seen him as person with solution mindset and always look for solution rather than thinking about the problem. ",
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXX"
}
},
{
"id": ZZZZ,
"recommendationText": "XXX is one of the most dedicated person at work.I always him with a flexible attitude and ready to adapt himself in all situation.I have seen him work all night to catch up all the deadlines and deliver on time ."
"recommendationType": {
"code": "colleague"
},
"recommender": {
"firstName": "XXX",
"id": "YYYY",
"lastName": "XXXX"
}
}
] } }
The problem comes, when I am using this URL in my Developer app.It doesn't give any error just simple return an empty map [:] as output in response
Irrespective of these recommendation fields, I successfully get the user basic profile data such as email, id, image,firstName,lastName.Means my code is working for other fields well but not for these recommendation fields*
To find the solution, I did some internet surfing and find a link of Linked API docs
Linked API Docs
As per Docs following selection of profile fields are only available
to applications that have applied and been approved for the Apply with
LinkedIn program:
Recommendation Fields
I already created a LinkedIn Developer account to get key & Secret
So how do I apply and get approval for Apply with LinkedIn Recommendation Fields.
I already have seen the LinkedIn support but can't find the way to ask question to the Linked Developer help support
Please suggest me the right way.
After a long internet surfing,I have found something fruitful that, I have to fill up a form to get these fields.Here is the form
along with its procedural details
You can use just recommendations-received keyword. Try the following link. I am getting all recommendations details with this link.
https://api.linkedin.com/v1/people/~:(recommendations-received)?format=json

Getting Photos Posted by User

I have following permission for my App.
[#"public_profile",#"user_friends",#"user_tagged_places",#"user_photos",#"read_stream"];
I am interested in two types of posts and photos from my friends.
Friend's check in at a place (Shown as "Friend Name" was at "Place Name")
Friend added Photos at a Place (Shown as "Friend Name" added X photos at "Place Name")
I am being able to get Case 1 by using
/friendId/photos/uploaded?with=location
The above call did not return me the Photos in Case 2. So I did
/friendId/feed?with=location&filter=app_2305272732
This returns me the posts in Case 2. The JSON I got back, there were two interesting paramers.
{
"id": "XXXXXXX",
"picture": "https://scontent.xx.fbcdn.net/xxxxx",
"type": "photo",
"status_type": "added_photos",
"object_id": "XXXXXXXX",
"created_time": "2015-03-09T02:23:28+0000",
"updated_time": "2015-03-09T03:18:48+0000"
},
picture and object_id. Picture gives me a very small thumbnail image, not an array off images added by my friend. If I do a GET on the Object_id I get
{
"error": {
"message": "Unsupported get request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100
}
}
Please advise what I am doing wrong and how I can get Case 2.
To retrieve the places that a person has been tagged in(in a status, photo, video etc), you could use:
/friendId/tagged_places
However to read the user's check-in, read_stream permission will be needed, which is going to be removed anytime and there seems to be no way to get it approved as of now.
As replied earlier, it needs the friend to use the app as well.

Resources