What you hjave copy/pasted is the “cURL example” of the call.
This should be translatable into however $languageYouUse makes HTTP/API calls.
I have written a PHP, NodeJS and Python example at https://github.com/BarryCarlyon/twitch_misc/tree/master/authentication/app_access_tokens