Total newbie: auth and commercial

If you have a look at the docs for App access tokens, it mentions “Since app access tokens are not associated with a user, they cannot be used with endpoints that require user authentication.” and also “They enable you to make secure API requests that are not on behalf of a specific user.”. What you are attempting to do though IS making a request on behalf of a specific user, in this case you want your app to start commercials on behalf of whatever channel you’re doing this for.

Which authentication flow you use is up to you and depends on your app, but you will need a User access token with the channel_commercial scope. This can’t be done ‘unattended’, it requires someone to actually be logged in to the Twitch account that you want to start commercials for, and go through the authentication process with your app. Once that is done though, and you have an OAuth token with the correct scope, you will be able to use the commercial endpoint for that specific channel.

1 Like