Error logging in when using token that has chat_login scope

You requsted as “OAuth Client Credentials Flow (App Access Tokens)”

You need a “OAuth Authorization Code Flow (User Access Tokens)”

3) On your server, get an access token by making this request:

POST https://api.twitch.tv/kraken/oauth2/token
    ?client_id=<your client ID>
    &client_secret=<your client secret>
    &code=<authorization code received above>
    &grant_type=authorization_code
    &redirect_uri=<your registered redirect URI>