Set the variables twitch-client-id
and witch-client-secret
as secret variables in your Postman environment,
curl --location 'https://id.twitch.tv/oauth2/token' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "{{twitch-client-id}}",
"client_secret": "{{twitch-client-secret}}",
"grant_type": "client_credentials",
"scope": "the scopes you need"
}'
const response = pm.response.json();
if(response?.access_token){
pm.globals.set("TWITCH_TOKEN", response.access_token);
}