justintv / Twitch-API

A home for details about our API
www.twitch.tv
1.72k stars 381 forks source link

Can't access API #609

Open PomegranateApps opened 7 years ago

PomegranateApps commented 7 years ago

I'm confused about the process of setting up a client ID. I'm trying to integrate the API for use in an iOS application. Why do I need to register an application with a Redirect URI?

glacials commented 7 years ago

The redirect URI is only if you want to have your users go through the authorization flow. You can set it to whatever (http://localhost works) if you won't use it.

ubershmekel commented 7 years ago

My webapp just died with { "error": "Bad Request", "status": 400, "message": "No client id specified" }

How do I get a client id?

glacials commented 7 years ago

You need to register your application at https://www.twitch.tv/settings/connections, which will give you a client ID.

esibun commented 7 years ago

The documentation really needs to be updated to reflect this. You will need to register an application as mentioned above and then use the Client ID in any requests you make to the Twitch API as such:

http://api.twitch.tv/kraken/channels/example?client_id=xxx

glacials commented 7 years ago

It's documented in the frontmost README here: https://github.com/justintv/Twitch-API#rate-limits

But if this isn't visible or obvious enough, open to suggestions.

calzoneman commented 7 years ago

It is not documented on the doc pages for individual routes; for example, copying and pasting the curl command on https://github.com/justintv/Twitch-API/blob/master/v3_resources/videos.md#get-videosid fails because there is no indication that a client ID is needed. It might be more clear if the examples had a placeholder for this.

What bit me was that the requirement is inconsistent -- I tested several videos before rolling out my usage of the API and all of them worked without a client ID, then the first time a user tried a video, it failed.

calzoneman commented 7 years ago

Another minor point that might help with clarity would be to rephrase the error message -- the most helpful error messages indicate a desired action ("registering a client ID at is required to use this API") rather than (or in addition to) simply stating a fact ("no client ID specified"). This makes it more obvious what's wrong and what needs to be done without asking about it on GitHub.

ghost commented 7 years ago

@glacials is there a changelog somewhere? or advanced notices about api changes somewhere?

i am only finding out about changes when my apps break

MellowNebula commented 7 years ago

@surindravg For official announcements regarding upcoming changes of this nature, I'd recommend: The Twitch Developer Forums TwitchDev on Twitter

Twitch provided advance notice of this change months ago, through a variety of mediums. eg. https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.t6vzky3ak https://discuss.dev.twitch.tv/t/client-id-will-be-required-in-august/ https://twitter.com/TwitchDev/status/728320286790017024

following up with numerous updates via Twitter as well as through threads such as this one for example: https://discuss.dev.twitch.tv/t/client-id-requirement-faqs

glacials commented 7 years ago

Fortunately one of the things enforcing Client-ID allows us to do is have better communication in the future because each client ID is backed by a Twitch account, which itself is a method of contact. So a benefit of this pretty jarring change is that it prevents pretty jarring changes.

Coriou commented 7 years ago

Working with Twitch's software is so damn frustrating. How can they introduce a change like that without any heads up or nothing...

freaktechnik commented 7 years ago

@Coriou it has been announced a long time ago on https://discuss.dev.twitch.tv/t/client-id-requirement-faqs/6108 which is the new "mailing list". At least it was at that point. And I also think twitch reminded everyone about it in an e-Mail they sent in relation to the API ToS update.

Coriou commented 7 years ago

@freaktechnik Huum my bad then. Really need to subscribe to this email !

PomegranateApps commented 7 years ago

This error just started happening today even though I am providing the client id. Is this a bug or did the way we have to provide the client id change?

"Bad Request: No client id specified".

jwmalara commented 7 years ago

Same for me,

Started happening @ 11:40am PDT, seems to be resolved as of 12:10pm PDT

{"error":"Bad Request","message":"No client id specified","status":400}

ghost commented 7 years ago

There was a site outage, recovery should be in process now and fully recovered soon. (This was a different issue than the original posted topic)

PomegranateApps commented 7 years ago

Yes, works for me now. Thanks.