Twitch API Change Stream attributes (C# Post Request)

Hi i wrote this code to make an Post Request within my c# application:

        {
            using (var request = new HttpRequestMessage(new HttpMethod("PATCH"), "https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=<my_broadcast_id>&scope=bits:read"))
            {
                request.Headers.TryAddWithoutValidation("Authorization", "Bearer <token>");
                request.Headers.TryAddWithoutValidation("Client-Id", "<client_id>");

                request.Content = new StringContent("{\"game_id\":\"33214\", \"title\":\"dscs\", \"broadcaster_language\":\"en\"}");
                request.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json");

                var response = await httpClient.SendAsync(request);
                Console.WriteLine(response.ToString());
            }
        }

This is the corresponding CURL Command:

curl -X PATCH ‘https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=76126553&scope=bits:read
-H 'Authorization: Bearer ’
-H ‘Client-Id: <client_id>’
-H ‘Content-Type: application/json’
–data-raw ‘{“game_id”:“33214”, “title”:“twitch api test”, “broadcaster_language”:“en”}’

I receive no error but the stream settings arent changed. Can anybody help me on this ?

shows correct here

https://api.twitch.tv/helix/channels/?broadcaster_id=76126553

{
"data": [
{
"broadcaster_id": "76126553",
"broadcaster_name": "bonbonn_",
"broadcaster_language": "en",
"game_id": "33214",
"game_name": "Fortnite",
"title": "twitch api test"
}
]
}

It may take a few moments/minutes for a change you make to be reflected in the API/frontend

This

curl -X PATCH ‘https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=76126553&scope=bits:read’

using (var request = new HttpRequestMessage(new HttpMethod(“PATCH”), “https://api.twitch.tv/helix/channels?scope=channel_editor&broadcaster_id=<my_broadcast_id>&scope=bits:read”))

Should be just

curl -X PATCH ‘https://api.twitch.tv/helix/channels?broadcaster_id=76126553’

using (var request = new HttpRequestMessage(new HttpMethod(“PATCH”), “https://api.twitch.tv/helix/channels?broadcaster_id=<my_broadcast_id>”))

Scope is not a parameter for this endpoint

Hi the title ist correct because is just tested the curl before i wrote this… .(

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