This was discussed quite a bit in the Twitch app chat room, and there are quite a few issues with doing something like this.
First off, Twitch want to keep to the specification, so it may not even be possible to implement something like this without breaking the specification.
Secondly, how would you even implement something like this? With an API request, say for example getting user data, it’s easy to make a request for multiple users as it’s just the addition of &id=...
for each user. A webhook subscription on the other hand requires multiple parameters for each: hub.callback, hub.mode, hub.topic, hub.lease_second, hub.secret
.
How would you send multiple sets of querystring parameters and have them relate to each other? One of the cleanest ways to handle notifications is to have a unique callback for each topic request, so simply having the hub.topic
parameter be repeatable wouldn’t work, you’d need them all repeatable. Grouping together each set of subscription parameters in an object, and then sending them all in an array in the request body wouldn’t work either as again that breaks the specification.
Authentication in a bulk subscription can also get tricky. What if one token is invalid, so one subscription needs to return an error, while the others need to return success?
So overall, bulk subscription would be quite a mess, unless the devs have thought of a clean way to do it that they haven’t mentioned yet.
With a 10 day lease time, 1000 separate calls really isn’t much at al. You can create all those subscriptions over the first min or two of your apps startup, then once they’re all up, stagger the resubscriptions and you’ll never need to have a big burst of subscriptions again. The devs have put a lot of work into trying to make the process as painless as possible, even for devs with needs to subscribe to tens of thousands of topics, the long lease time and staggered subscriptions really helps even on that scale, and for large initial subscriptions the request for a higher rate-limit is processed much faster than when it was initially made available.