Api: Feature Request: GetPartnerships Twitch Update

Created on 11 Jan 2019  Â·  16Comments  Â·  Source: Bungie-net/api

Twitch is shifting away from usernames to user IDs, and if you are only storing usernames I think you could actually be losing data when Twitch members change their usernames. If you've got the user IDs in the background and are only returning the username, simply returning their ID as well would save us a Twitch API call to convert the username to an ID.

This is a very minor thing, and adding other services like Discord as requested in #520 would probably be more beneficial long term, but it would be a nice small QoL update.

bug investigation

Most helpful comment

Actually, until they remove their v5 api, there might be an upgrade path for you. The API can be handed a username and it returns the user id (or nothing if that username doesn’t exist). They also hand you the account creation and a modified date. The dates could potential help you find account reuse assuming you have a record of when the integration was made, and assuming those dates are relevant.

All 16 comments

Oy, admittedly we've deprecated our support for Twitch. Ever since we removed the Twitch integration from the site, we've basically kept it online only because we knew some 3rd party devs found the linkage useful: but we've entirely run out of time to maintain it, and I fear that I'm not going to be able to convince anyone with all the other tasks we're doing right now that we need to maintain it.

However, I will bring it up. I would like to continue serving it - and I know it provides some really neat opportunities for apps that would not be feasible otherwise - I'm just not sure if or when I'd get the thumbs up to actually work on it. :(

To offer a difficult-but-relevant point, do also consider taking the
Twitch integration offline altogether; username changes would mean
that any linkages become "possibly false", rather than simply "ok but
legacy". I am aware this is a hard thing for Twitch integrations and I
feel awful saying it, but the potential for misrepresentation is
always a factor to me.

If you’re not storing the IDs then yeah, any data you have right now is
potentially invalid. Twitch hasn’t released usernames for reuse other than
the one time (that I know of), so impersonation isn’t likely currently, but
could be over time.

That said, if you have the framework for it and just have it off, it’s
nothing more than the ID you need to store versus the username.

The site I run for our clan does pull twitch accounts from your API, then
converts them to twitch IDs to then get live streams to show randomly. It
would be sad to lose that, but I would completely understand.

Indeed, we created the system before the User ID switch-over. We had a backlog item to convert to the use of User IDs before the Twitch feature on BNet was cut, at which point it ended up lingering in the backlog and indeed contains inaccurate data that now cannot be corrected. It's really only been kept alive because I knew of a couple of fan sites who were finding the data useful: but it doesn't sound like it's even useful to them anymore in its current state.

I'll talk to some folks in the morning: unfortunately, I think the end result of bringing attention to it will likely be that we'll end up bringing it offline, as we don't have the resources to bring the feature back to life. But it'll be good to check up with them on it and get confirmation of what we want to do next.

I apologize to anyone who has been using this API - yourself, and the couple other sites out there that have been using it. Hopefully, even if we turn it off for now, there'll be some time in the future that we can bring it back. It'd likely have to be associated with something we're doing either on the site or on our Companion app for us to get the green light to start working on it again, but I do think there was potential for amazing things with the idea. I feel like sites such as Guardian Theater were evidence of that.

I should note though that there is room for opportunity in this realm, even outside of Bungie's control.

For instance, in your use case, if you were to make an app and get your clanmates to link both their Bungie credentials and their Twitch credentials through it, you could theoretically make your own Twitch-to-Destiny integration and show them videos from their fellow clanmates! The only thing Bungie really provided that couldn't be done by someone else was that one time incentive to get people to add their linkages: but in your particular use case, you've got willing participants (your clanmates!)

And if you implement that as a two-part service, one with an OAuth provider that acts as an OAuth client to both Bungie and Twitter, and the other that is a cool-video site that uses your magical B-T-OA provider service, then everyone could build on top of it!

That would be very neat!

In theory it wouldn’t be overly difficult either, I have working twitch and Bungie oauth, and this isn’t a situation where you even need to really remember any of the authentication information, you literally just want to keep a database with the Bungie membership id and associated twitch user id. The UI and how to provide that data out for any websites that want it would be the hard part (to me).

I might work on this some if the api is shuttered.

And indeed, that's totally what we were doing as well! We grabbed/grab the Twitch auth long enough to get their vital info, and then toss the auth token out.

If you do decide to do it, I'll cheer you on! I mentioned these old endpoints today, and I think there's sentiment to preserve them/restore them to usefulness "when we get time" - but with all the work on our plate right now, I just don't know when that'll be. And we'd have to do something about all these accounts that have likely gone out of sync due to username changes... probably toss them out if we can detect that it changed in some way, and then try to get folks to sign up again. If it ever gets revived, that'll be a bit of a to-do.

Actually, until they remove their v5 api, there might be an upgrade path for you. The API can be handed a username and it returns the user id (or nothing if that username doesn’t exist). They also hand you the account creation and a modified date. The dates could potential help you find account reuse assuming you have a record of when the integration was made, and assuming those dates are relevant.

Ooh, slick! Okay, so if we can find time to do this before we remove the v5 API, there may be hope. I dig that, and perhaps that can motivate us to make time for it before it's too late. Thank you for this info, I appreciate it! I've not looked at the Twitch API since the feature got cut, it's good to know there's some options on the table.

The “new” twitch api has a similar endpoint to convert a username to a userid that isn’t going away, but it doesn’t give you the dates. If the dates aren’t helpful though...

The dates will definitely be helpful for us - I think that's going to do the trick. If the username changed since they registered with us (which we do have), then we throw them out and someone (those of you who want to link to their streams, or us with some sort of incentive) will have to convince them to re-link. But that's better than showing the wrong/no data for them! I dig it.

The modification date isn’t documented, it might not mean username change. It would have to be checked on with Twitch.

Either way, it’s something.

Cool - yeah, I dig it, it gives me hope that we might be able to revive this dead feature at least. Thanks for the lead!

With the Twitch Prime integration and us now even having Twitch as a login option on Bungie.Net, is this potentially coming back in a more useful way?

Was this page helpful?
0 / 5 - 0 ratings