I have been trying for hours to generate a clip programmatically but I do not understand the way twitch wants the request formatted. I am not used to CURL but I’m pretty sure I am sending the headers correctly.
All I get is “{“error”:“Unauthorized”,“status”:401,“message”:“Missing User OAUTH Token”}”
I have broadcaster_id in the URL because it doesn’t seem to read it anywhere else so I tried doing the token in the URL too but none of the GET names I’ve tried work. I can’t find any examples online of people using POST with PHP on anything that requires an oauth.
Any help would be great i am at the end of my rope here
Yeah I’ve not had coffee yet and read your title but not your code.
So your code looks correct (but you should removed the &access_token='.$token.'&token='.$token from the URL)
You’ve just got the wrong token type.
You generated a server to server token, which doesn’t represent a user.
So you need an oAuth flow (mini website) to obtain a user token with the clips:edit scope applied. So the API call can create a clip owned by the authenticating user.
Yeah I just had the redundancy in there in a desperate attempt to get it to see the token.
Thank you so much for your help. I thought since this is going to be a server->server thing I would need the other token. A user token didn’t make sense to me but it is working now so thank you so much for your time