@night Hey, i found where the problem was. I was not authenticating my app with twitch and i was passing the wrong OAuth … Now is solved, if anyone is looking for the same here is the code i used:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(prefix + requestUrl);
request.ContentType = "application/json";
request.Method = "PUT";
request.Accept = "application/vnd.twitchtv.v3+json";
request.Headers.Add("Authorization: OAuth " + accessToken);
var formattedData = JsonConvert.SerializeObject(obj);
UTF8Encoding encoding = new UTF8Encoding();
byte[] buffer = encoding.GetBytes(formattedData);
Stream reqstr = request.GetRequestStream();
reqstr.Write(buffer, 0, buffer.Length);
reqstr.Close();
string ret;
WebResponse response = null;
try
{
response = request.GetResponse();
}
catch (WebException ex)
{
if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.BadRequest)
{
}
response = (WebResponse)ex.Response;
}