Did you exchange the returned ?code for an access token as per step 3?
3) On your server, get an access token by making this request:
POST https://id.twitch.tv/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>
Here is a sample request:
POST https://id.twitch.tv/oauth2/token
?client_id=uo6dggojyb8d6soh92zknwmi5ej1q2
&client_secret=nyo51xcdrerl8z9m56w9w6wg
&code=394a8bc98028f39660e53025de824134fb46313
&grant_type=authorization_code
&redirect_uri=http://localhost
Aha, I haven’t done phase three so far. Thanks to you, you received a refresh token and an access token! But the status is still 401, what should I do to use the API freely?
Fortunately, I sent the request from the beginning and received the token in the form of JSON. By the way, how can I use the API using the token I received now?
The status of 401 is the result of the api requested by axios.get().
Below is the response I received after running step 3.
I put in the access token and it works well. I think I know what the problem was now. I think it was because I didn’t go through the middle stage. Thank you!