I’m trying to get a users follower count, this is public information so I don’t see the user needing to login to their Twitch account or anything like that. The code I’m currently using is as follows:
Thanks for the quick reply. I’ve tried the links above however when I make my requests I get webpages back instead of the auth token? I’m using http://localhost as my redirect if that has any impact?
You’re getting a web page because you need to actually send the user you need an OAuth token from to that URL. Once their on Twitch they’ll see a confirmation box asking if they wish to grant your app whichever scopes you’ve requested, and then they’ll get redirected to your redirect URL.
Alternatively if you don’t require any user scopes, and are doing this on your server, you can use the Client Credentials flow to generate an App Access Token, which doesn’t require user interaction.
Fantastic! Thank you so much for pointing me towards the Client Credentials flow, I think this is exactly what I was looking for. The next issue I’m getting is that I’m getting an Error 400 when using the following code:
As far as I can see I’m mimicking the request that is being shown on the website using the same URL and names for fields, sorry if I’ve missed something obvious with this and thanks for the help so far.