Token with scope clips:edit no more working

Hi

Since this working my access_token is no more working, i have :

{"error":"Unauthorized","status":401,"message":"Must provide a valid Client-ID or OAuth token"}

I tried to regen a new Bearer Token

$ curl -X POST "https://id.twitch.tv/oauth2/token?client_id=MY_ID&client_secret=MY_SECRET&grant_type=client_credentials&scope=clips:edit"

it give me :

{"access_token":"TOKEN","expires_in":5651106,"scope":["clips:edit"],"token_type":"bearer"}

For now, everything is OK

But then :

$url = 'https://api.twitch.tv/helix/clips?broadcaster_id=121445595';
$ch = curl_init();
$headers=['Authorization: Bearer TOKEN'];
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
var_dump($response);

it give me :

{"error":"Unauthorized","status":401,"message":"Missing clips:edit scope"}

but as we saw before, scope is OK.

Do you have clue to help me please ? :smiley:

That’s not refreshing a token, that’s generating an App Access token. That’s completely different from a User Access token and as such it is not possible to have that scope associated with it.

To refresh a token you should follow the docs on how to use your refresh token to generate a new User Access Token https://dev.twitch.tv/docs/authentication/#refreshing-access-tokens

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