calendar events - 10K recipients limit problem for large events - microsoft-graph-api

Use case:
For online platform integration we want to send invites for events using endpoint
POST /users/{id | userPrincipalName}/events
We handled the limit of 500 attendee by splitting large event to multiple calendar events containing each 500 attendees emails
New problem is 10,000 recipients a day limit
If event has large audience (ex. 100 000 person webinar event) we get blocked after 10K recipients ( 20 calendar events each having 500 attendees)
how to go around this, how to scale calendar events?

Related

Places room endpoint not returning all rooms

If I call the endpoint /places/microsoft.graph.room I only get some of the rooms. If I use the findRooms method I can see all the rooms. The rooms (mailboxes) all have identical permissions. The rooms that are not visible were created in the last couple of hours.
Is there still some 60 hour cache here like mentioned in another question (which is about room lists and not rooms): Places Room List API returns cached data?

Retrieve all messages in Slack(more than 1000)

I want to retrieve all the messages that were sent in my teams slack domain,more than year.
i'm using channels.history method to retrieve the history of each channel,
But this method returns maximum of 1000 records only.
count 100 Optional, default=100
Number of messages to return, between 1 and 1000.
And i dont have access for https://my.slack.com/services/export to export all the data.
Also timesatmp is not way to get the desired data, beacuse my slack channel recived more than 1000 message per day
Are there any possibilities?
Yes, you can get all messages with channels.history for your situation. Here is how:
Call the method once to get the newest 1000 messages (1st chunk)
Call the method again with latest property set to the timestamp of
the oldest message you received in the last chunk and the
inclusive property set to false. This will get you the next
chunk of 1000 messages
Repeat until you received all messages
Remember that the rate limit is 1 call per second, so make sure you don't call the API more often.

Count operations in Parse

"Count operations are limited to 160 count queries / minute period for each application. The limit applies to all requests made by all clients of the application".
Sorry but i haven't understand very well what it means. This limit refers to a single app on a single device ? Or if i have 160 clients they can do only 1 request per minute?
Thanks in advance
This limit is per app, all users of your app can make 160 count queries a minute in total, so yes, with 160 users you would get 1 count query per user/minute.
In general, you should avoid count queries altogether and instead use counters to keep track of counts. This however depends on what you are doing and would be out of scope of your question itself.

Creating a subscription in Stripe - I'm confused

I use stripe subscriptions for my users with one plan for, say, $10 per month for 100 API requests and that's a standard price. However, if the user has used 150 API requests, I charge them $10 + $3. For 200 and more requests it's $10 + $7.
Say, I've subscribed the user on October 9th. On November 9th the webhook event invoice.created will be called by stripe. So if the user has used 150 API requests, I have to add $3 more to the basic price (I can do that only within 1 hours according to Stripe documentation https://support.stripe.com/questions/metered-subscription-billing).
if even.type == 'invoice.created'
Stripe::InvoiceItem.create(
customer: stripe_customer_id,
invoice: event.data.object.invoice
amount: 300,
currency: 'usd',
description: 'additional price'
)
The questions:
Will the event invoice.created, indeed, be called on November 9th for the first time?
Will that additional price of $3 be added to the current invoice of $10 for October 9th-November 9th or will it be added to the future invoice for November 9th-December 9th? From the documentation it's not clear.
How do I add metadata to the original invoice of $10? I can add metadata to the additional invoice but in case the user has used less 100 API request I don't have to create the additional invoice at all, so I can't rely to the additional invoice.
It says
Create any invoice items before your customer is subscribed to the
plan, and then create the subscription via an update customer
subscription call.
but I subscribe the user once and forever on October 9th! How can I create an InvoiceItem before or on that (on October 9th) date if one month hasn't passed yet, and thus it's not known how many API calls the user makes (on October 9th the user has made, obviously, zero API calls)? I can only create InvoiceItems in 30 days because it's when I know how much to charge them on top on the $10! On October 9th I don't know that. Don't I understand anything?
Each time an invoice is created, you get the event invoice.created on your webhook. So when you subscribe a customer to a monthly plan on the 9th of November, you will get this event on the 9th of November, on the 9th of December, on the 9th of January, etc.
The first invoice for a subscription (generated when you create a subscription) is always closed immediately, so it is not possible to add an invoice item at that point. If that's something you want to do (for a setup fee for example) you need to create the invoice item before creating the subscription. That way it would get added automatically to the first invoice created when subscribing your customer.
In your case, you want to add fees to the next invoice based on the number of API requests your customer made during the month that just ended. So in the invoice.created event you need to detect whether it's a new month starting or the first one. If it's a new month, you then need to decide whether you have to add an Invoice Item to the user or not (based on the number of API requests).
You can't add metadata to the previous invoice from the month before. You just need to add the invoice item to the current invoice (for the month that is starting) and put a description indicating that the extra line item is for the consumption for the previous month.

Collecting follower/friend Ids of large number of users - Twitter4j

I'm working on a research project which analyses closure patterns in social networks.
Part of my requirement is to collect followers and following IDs of thousands of users under scrutiny.
I have a problem with rate limit exceeding 350 requests/hour.
With just 4-5 requests my limit is exceeding - ie, when the number of followers I collected exceeds the 350 mark.
ie, if I have 7 members each having 50 followers, then when I collect the follower details of just 7 members, my rate exceeds.(7*50 = 350).
I found a related question in stackoverflow here - What is the most effective way to get a list of followers using Twitter4j?
The resolution mentioned there was to use lookupUsers(long[] ids) method which will return a list of User objects... But I find no way in the API to find the screen names of friends/followers of a particular "User" object. Am I missing something here.. Is there a way to collect friends/followers of thousands of users effectively?
(Right now, I'm using standard code - Oauth authentication(to achieve 350 request/hour) followed by a call to twitter.getFollowersIDs)
It's fairly straightforward to do this with a limited number of API calls.
It can be done with two API calls.
Let's say you want to get all my followers
https://api.twitter.com/1/followers/ids.json?screen_name=edent
That will return up to 5,000 user IDs.
You do not need 5,000 calls to look them up!
You simply post those IDs to users/lookup
You will then get back the full profile of all the users following me - including screen name.

Resources