C# code problem with client id

Hello i have problem becouse i dont know how i can get client id.

i know u need register new app to get one of them but u need give your site url to finish registration but i dont have any site and i wanna make program when i use c#.

or mby i dont need client id and my code is wrong .

 async void test()
        {
            var client = new HttpClient();
            client.DefaultRequestHeaders.Add("Client-ID", "axjhfp777tflhy0yjb5sftsil"); //i dont know what client 
            id must be its client id on exapmle 
          
            HttpResponseMessage response = await 
            client.GetAsync("https://api.twitch.tv/helix/gamesid=493057");

            HttpContent responseContent = response.Content;

            string responseBody = await response.Content.ReadAsStringAsync();
            richTextBox1.Text = responseBody;

        }

if i use this code i get {“error”:“Unauthorized”,“status”:401,“message”:“Must provide a valid Client-ID or OAuth token”}

sorry for my english its not my first language i have hope anyone understand what my problem is.

You get a Client ID from registering an app on https://dev.twitch.tv/dashboard/apps Your website doesn’t need to be finished to register.

I can confirm your code does work with a valid Client ID.

But if i dont have site then what i need write on OAuth Redirect URI ?

http://localhost is one option

1 Like

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