I want to do a sync action in my client side, so need to know how to get all deleted contact list.
By the api (GET /me/contacts), I could get all contact list
But it wastes much time when the user has large contacts.
This api (GET /me/contacts/{id}) tell us the contact is exist or not.
it is inefficient to check every contacts are deleted or not for me.
Which apis do I use? thanks for your help.
Why not use the delta query preview in the /beta endpoint? That should do what you want.
More efficient way for you to check which contacts were removed is getting just the list of contact ID's and then doing the diff between list of ID's returned by graph, and local list.
You can use query parameters to retrieve just the ID's of the contacts, instead of getting the whole objects.
Method url:
https://graph.microsoft.com/v1.0/me/contacts?$select=id
Related
I am trying to get the total number of users within a Slack workspace. Just the count.
Things I've considered:
Iterating over the users.list
Unnecessarily heavy on the API and gets me waaaay more data than I need (the less I know about the users, the better imo)
Includes inactive users (so cannot get a proper indication without iterating over everything)
Using conversations.info
Requires a scope that I currently don't use (channels:read). Getting read access to channels seems like a very intrusive permission (even though my app doesn't use it and I don't want to scare off users by requesting this sort of information).
Is there an easier way to getting this information or any ideas I have not considered yet? Let me know!
You could make a call to [conversations.members][1] for the #general channel. It won't return a total number of users but it will return a list of all user ids pertaining to members of that channel, you'd just need count the ids on your end. Every user on a workspace is automatically added to the #general channel. No one can leave that channel nor can it be deleted or archived so it's sure to have the most accurate count of total workspace users. The conversations.members method does require the channels:read scope though so that's something to keep in mind.
I am using typeform to generate leads for my company through a landing page and it asks for a phone number. I am using this phone number to call them and when they pick up I add them to my teamleader CRM system. However, this is very inefficient because I have to add all those leads to Teamleader manually.
I have created some zaps through Zapier to automatically generate contacts in Teamleader when a new Typeform entry is submitted, however, some people fill in the form more than once. Also, I am using more than one typeform and some people fill in different forms with the same data. Therefore, I was wondering whether it is possible to have Zapier check whether a certain phone number is already in my teamleader database, and only create a contact when this particular phone number does not yet exist.
I have already tried using a filter, but I noticed that Zapier can only filter typeform contacts based on their ID, which is not helpful.
I hope someone can help me!
Thanks in advance.
After checking the official APIs of Teamleader https://developer.teamleader.eu/#/reference/crm/contacts/contacts.list I think you can search users by their number,name or email.
You can also load all your data into airtable and use it as a lookup in zapier. Alternatively you can request this feature from teamleader on their Zapier app.
I'm working on an iOS app which at one point displays a feed of information items to the user, that contain information about other users. These feed items are stored on a server that I run as well. I want to add a functionality that allows this user to filter the information and display only items of his facebook friends. It seems to me that there are three ways to achieve this
1
Client fetches all items.For each item run that FB SDK query /user-id/friends to determine friendship
2
Save all of the facebook ID's of the users friends on the client (each set time),and after fetching all items, determine if item is posted by friend with comparison to local database of friends.
3
The server with the feed items would run the query in the backend, and filter the content it provides to the client
Each of these has it's weakness and advantages, but I'd like to hear which is the preferred and "best" overall. I'm trying to achieve something like VENMO's home feed functionality if that makes sense.
Thanks for the help!
I have used Twitter API for fetching the tweets with a particular hash tag and all the data stored in my database.
I am currently working in core PHP.
API is working fine, thanks to Twitter
Now problem comes with the deleted tweets, Actually when a record of 100 latest tweets comes on my ajax file directly I store them in my database with a flag visible="y" . Now I want that if any of tweet stored in my database is being deleted from responsive twitter account automatically set visible = "N" into my database.
I searched a lot on internet but I could not find any respected answer.
Please reply me and ask me if any further information is needed.
Thanks to Stack Overflow for a good community.
The only way to do what you're suggesting, is to run some process that reads the tweets from your database and checks to see if they are still there.
You can call https://api.twitter.com/1.1/statuses/lookup.json and pass it a comma-delimited list of 100 tweets, and then compare the return value to your database to see if the tweets you asked for are still available or not.
You will have to iterate through your database 100 tweets at a time. Depending on how many tweets you are storing, you may run into rate limit issues.
You can make the status lookup call wit map parameter set to true. It will return null for deleted or protected tweets. It is more reliable way when compare to map set to false, because many a times lookup call doesn't return tweets even if it is not deleted (esp. for retweets).
If I want to download a list of all of my followers by calling the twitter API, how many calls is it? Is it one call or is it the number of followers I have?
Thanks!
Sriram
If you just need the IDs of your followers, you can specify:
http://api.twitter.com/1/followers/ids.json?screen_name=yourScreenName&cursor=-1
The documentation for this call is here. This call will return up to 5,000 follower IDs per call, and you'll have to keep track of the cursor value on each call. If you have less than 5,000 followers, you can omit the cursor parameter.
If, however, you need to get the full details for all your followers, you will need to make some additional API calls.
I recommend using statuses/followers to fetch the follower profiles since you can request up to 100 profiles per API call.
When using statuses/followers, you just specify which user's followers you wish to fetch. The results are returned in the order that the followers followed the specified user. This method does not require authentication, however it does use a cursor, so you'll need manage the cursor ID for each call. Here's an example:
http://api.twitter.com/1/statuses/followers.json?screen_name=yourScreenName&cursor=-1
Alternatively, you can user users/lookup to fetch the follower profiles by specifying a comma-separated list of user IDs. You must authenticate in order to make this request, but you can fetch any user profiles you want -- not just those that are following the specified user. An example call would be:
http://api.twitter.com/1/users/lookup.json?user_id=123123,5235235,456243,4534563
So, if you had 2,000 followers, you would use just one call to obtain all of your follower IDs via followers/ids, if that was all you needed. If you needed the full profiles, you would burn 20 calls using statuses/followers, and you would use 21 calls when alternatively using users/lookup due to the additional call to followers/ids necessary to fetch the IDs.
Note that for all Twitter API calls, I recommend using JSON since it is a much more lightweight document format than XML. You will typically transfer only about 1/3 to 1/2 as much data over the wire, and I find that (in my experience) Twitter times-out less often when serving JSON.
http://dev.twitter.com/doc/get/followers/ids
Reading this, it looks like it should only be 1 call since you're just pulling back an xml or json page. Unless you have more than 5000 followers, in which case you would have to make a call for each page of the paginated values.