You’re using the authorization code flow and getting a code instead of a token, which is why it is coming back invalid. In the authorization code flow, you have to exchange the code to get a token. Currently, you’re trying to pass in an auth code as a token. If you want to continue using that flow, you’ll need to exchange the code for a token. Otherwise, you can get an OAuth token directly with the implicit grant flow.
Docs here for more information: https://dev.twitch.tv/docs/authentication/