I have not been able to find a method of using the graph to subscribe to all users changes, it looks like it is not possible.
So I set about subscribing to everyone individually, ideally I would like all updates from calendars, email and contacts eventually, but I started with calendars.
The code works perfectly with just my user, however when I try to subscribe for everyone (around 300 users), I hit a hard a limit, at seven subscriptions, as in further requests fail with a generic Bad Request status.
In the official docs https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/webhooks it says:
Limitations
Certain limits apply and may generate errors when exceeded:
1) Maximum subscription quotas
Per App: 50,000 total subscriptions
Per Tenant: 35 total subscriptions across all apps
Per App and Tenant combination: 7 total subscriptions
It seems that Tenant refers to an actual active directory, so we are limited to 7 per app, or 35 in total.
There is zero chance of splitting users into multi Active Directories of domains, even juggling multiple apps to do the same thing seems strange, these limits make no sense at all to me.
Is there any way to increase these tiny limits?
I am subscribing to users/$email/events so I post to https://graph.microsoft.com/v1.0/subscriptions
{
"changeType": "created,updated,deleted",
"notificationUrl": "https://webhooks.mydomain.com/my/endpoint",
"resource": "users/$email/events",
"expirationDateTime":"2018-05-12T16:00:00.9356913Z",
"clientState": "my-super-secret-identifier"
}
And it works great, as long as I want <=7 subscriptions. I also subscribed to, the root /users to see if that would give me all changes, which meant I could then only subscribe to 6 individual calendars.
I am using the official PHP library, but presume/hope that doesn't matter.
As Jason said in the comments, the restriction in the question should only have applied to Active Directory Resources, not on the user level, the docs have now been changed:
Azure AD Resource Limitations
Certain limits apply to Azure AD based
resources (users, groups) and may generate errors when exceeded:
Maximum subscription quotas:
Per App: 50,000 total subscriptions
Per Tenant: 35 total subscriptions
across all apps Per App and Tenant combination: 7 total subscriptions
Whether it was a case of the power of suggestion causing the issue, or some transient bug somewhere I don't know, but the Gods of the Interwebs have smiled on me, and my code works now; even though I didn't change it.
Maybe removing and adding permissions helped in my case? Not sure.
At least the docs are right now.
I'm going to add an answer (because I can't comment, but this would have helped me to know).
The "AD" in the documentation "Azure AD" means "Active Directory" which seems to be something a little different than just the Graph API. In any case, I was able to set up 62 subscriptions, to the same calendar, on the same user, and promptly got 62 notifications after making a change to the calendar. I wanted to test the limits, but I figure 50,000 is a bit much to sit and click the button in the graph API explorer, so I stopped at 62. In any case, it's possible to add more than 7 and more than 35 subscriptions.
The account in question was registered by a company, however apparently not Active directory... Or the documentation is just wrong or being wrongly interpreted. In these cases it's hard to tell sometimes :)
Now there are more subscriptions allowed. But these are relevant only for Azure-AD managed resources. For example there can be thousands of mailbox subscriptions per App and tenant (I checked personally).
https://learn.microsoft.com/en-us/graph/webhooks#azure-ad-resource-limitations
Maximum subscription quotas:
- Per app (for all tenants combined): 50,000 total subscriptions
- Per tenant (for all applications combined): 1000 total subscriptions across all apps
- Per app and tenant combination: 100 total subscriptions
Related
I'm designing a web application that needs to retrieve and organize emails from at least 100 mailboxes from our company's domain. Something like:
abc#company.com
cde#company.com
efg#compnay.com
...
My web app needs to check each of these emails every couple of seconds to retrieve the new emails and index them. However, I don't want to hit the API limit for them.
Reading the official documentation, it seems like I can have a single app ID and use it to retrieve all these informations and won't hit the API limit.
If I have 100 mail boxes, and let's say, check each mailbox every 10 seconds (with maximum 4 concurrent threads), is it safe to say that I won't hit any kind of rate limit?
It might be worth mentioning that I'm going to use the Delta Link feature to check for new emails. This will make things faster and I'm not sure if it has any effect on the rate limits.
You really need to decrease the frequency of direct hits and only do that once you receive a notification from a particular mailbox/folder.
See https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=http for details on Graph event subscription.
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.
We are now getting an error within our Book A Room powerapp when trying to find available meeting times. The error has only started since we added a new room which takes us to 21 rooms in our Office 365. The error is as follows:
The issue seems to be that in the API request all 21 rooms are included in the requiredAttendees json attribute. Once I remove the newly added room on Office365 the error goes away.
All rooms in the catalogue need to be included in the request to see whether they are available for booking but is this limit of 20 a hard limit on the API side? If so, what alternatives do I have?
I'm not familiar with the Office365.FindMeetingTimes() endpoint, but if this is a limitation of the API, then it sounds like you may need to implement a sort of paging in your app. The first time the app calls FindMeetingTimes(), you'll have to pass in the first 20 rooms. Then if the user isn't satisfied with the proposed times, they can initiate a "find more times" feature that will call FindMeetingTimes() with the next 20 rooms. I'm not sure if this is the best solution, but it could be a workaround.
I am creating this survey to track exit interviews for my job. I am wondering, and could not find anywhere, if i fill up my 100 responses for one survey then what happens? Will I not be able to ever view the next ones over 100? Can I just delete old survey responses and view new ones? Will these new ones be recorded in the data of the surveys? Do I have to make another identical survey to record more responses?
Thanks
Pretty clearly described on their pricing page.
With a free plan, you can collect more than 100 responses, but you can only view the first 100 responses. Upgrade at any time to access additional responses. Our STANDARD Monthly plan includes 1000 responses per monthly billing cycle across all your surveys with a $0.15 charge per additional response. All annual plans include an unlimited number of responses.
If you need more than their free trial offers, pay for the service.
The functionality I'm trying to implement is used in a site called Wefollow ( http://wefollow.com/ ):
On this WeFollow each account is checked for
# of followers
# of statuses
How can reliably update the information for each account without bumping into the 2000 queries/hour limit imposed by Twitter?
I'm trying to build a directory and update the same details. How can I deal with this?
Help would be very much appreciated.
EDIT: I'm trying to understand how that site works, not promoting it. I'm sorry if I wasn't clear enough.
If there's a hard limit, there's a hard limit. I would do this by putting all accounts in a rotating queue and updating them in that order up to a given maximum. If you can't cover all accounts, that's too bad. You could also calculate activity values based on deltas per user and prioritise the updating of those users. If a user hasn't changed in a month then there's no point checking that user more frequently than every week. Likewise, if a given user is very active, they can be pushed to the front of the queue.
BTW I would say this is verging on not programming related.
You can apply to have your IP address and account whitelisted which will increase your rate limit to 20,000/hour if you are approved. (http://apiwiki.twitter.com/Rate-limiting)
At FanPageList.com, we update information for our accounts every 2-4 hours. If you look closely at wefollow.com, some of their counts are outdated. Even at TwitterCounter.com, they only claim to update their counts daily (unless you pay for their paid service, they will start tracking your account hourly).