Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streams list response empty when including client_id #281

Closed
levi opened this issue Nov 21, 2014 · 5 comments
Closed

Streams list response empty when including client_id #281

levi opened this issue Nov 21, 2014 · 5 comments

Comments

@levi
Copy link
Contributor

levi commented Nov 21, 2014

When I access the current live streams via

GET https://api.twitch.tv/kraken/streams?client_id=test-client-id
Accept: application/vnd.twitchtv.v3+json

I receive a response with an empty array of streams. However, if I remove the client_id parameter, the response will return an array of streams as expected. This appears to be a bug.

@bashtech
Copy link
Contributor

Not exactly a bug, more like unintended functionality. The streams API also accepts a client_id param as a filter (Twitch internal use maybe?) which is why the endpoint returns no results when it is passed in the query string.

This is one of the reason the only supported method of passing the client ID is as an HTTP header.

@levi
Copy link
Contributor Author

levi commented Nov 21, 2014

This is one of the reason the only support method of passing the client ID is as an HTTP header.

@bashtech thanks for pointing this out. I haven't seen anything in the documentation about it. Are you merely suggesting that its the best method or is there a header key I can pass the client ID to?

@bashtech
Copy link
Contributor

See https://github.com/justintv/Twitch-API/blob/master/README.md#rate-limits

On Nov 21, 2014, at 1:11 PM, Levi McCallum notifications@github.com wrote:

This is one of the reason the only support method of passing the client ID
is as an HTTP header.
@bashtech https://github.com/bashtech thanks for pointing this out. I
haven't seen anything in the documentation about it. Are you merely
suggesting that its the best method or is their a header key I can pass the
client ID to?


Reply to this email directly or view it on GitHub
#281 (comment).

@levi
Copy link
Contributor Author

levi commented Nov 21, 2014

@bashtech that's absolutely hilarious, because it's contrary to the recommendation of the rest of the docs. I'll put together a pull request to make this more known!

EDIT: Would be great to have someone from the Twitch API team chime in here and let us know what the prefered method of client_id submission is. Some places I see it being used as a GET param and only one occasion do I see it recommended as a header value. I think it would make the most sense for this key to be a header value at all times, since it would clean up request URLs.

@levi
Copy link
Contributor Author

levi commented Nov 21, 2014

Ok, I see what's happening here. Not so much a bug, but a documented query for the /streams endpoint. I have been using the GET parameter of client_id throughout my requests as a result of this example request. I'll add a pull request to update that example so others won't make the same mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants