401 from Create Video

So here’s what I do: I successfully obtain a code via “OAuth Implicit Code Flow (User Access Tokens)” with the scope channel_editor (note: I don’t pass an Authorization header and I close the browser after redirect). Then I attempt to create a new video via the Create Video endpoint, and I always get a 401 Unauthorized with the message “authentication failed”. I’m passing the channel_id and title as part of the URL, no body and the headers are Accept: application/vnd.twitchtv.v5+json, Authorization: OAuth <code>, Client-ID: <client-id>, charset: utf-8. I’m in doubt regarding the channel_id as I’ve read that it is also the _id of the user, which I obtained by querying the endpoint users?login=<name>, where I assumed that the <name> is the channel name and/or user name. Every time I attempt to create a new video, I can see on my Twitch account in the Settings under “Connections” that I authorized the app to use my account as every create video attempt updates the timestamp of the last authorization. What do I need to do in order to successfully create a new video entry? Is this description of the procedure supposed to work and a more detailed investigation is needed? Would the response headers Twitch-Trace-Id and X-Ctxlog-Logid be of help for the support to look into it or could I provide staff with the channel_id and code I obtained?

You should of answered your own thread with the answer, now your unknown thread cannot help anyone else with the same issue

Confused OAuth Authorization Code Flow with OAuth Implicit Code Flow as their documentation aren’t separated and they seem to differ only in response_type and the steps required, so my request URL asked for response_type=code where it should have been response_type=token. The OAuth response_type=code isn’t a valid access_token and would need to be exchanged for the latter, therefore the 401 was legit.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.