Programattically Get User OAuth Token for Subscriber Notifications

So you are using Twitch Webhooks.

You need to generate and use a “App Access Token” also called “OAuth client credentials flow”

That is documented here

You use the ClientID and ClientSecret to generate a server to server app access token, and specify that with your clientID in the headers to the webhook creation request.

You can use the App Access Token for this call also

becomes

headers = {"Client-ID": self.client_id, "Authorization": "Bearer " + yourGenerateToken}

You shouldn’t generate a token for every request, an app access token is valid for around 60 days.

POST https://id.twitch.tv/oauth2/token
    ?client_id=<your client ID>
    &client_secret=<your client secret>
    &grant_type=client_credentials

No scopes needed. What you did here:

Got you a working token, you just don’t need any scopes