Skip to main content

How to pull data from monday.com using API in c#. I have tried the following code and it doesn’t work.


            var httpWebRequest1 = (HttpWebRequest)WebRequest.Create("https://api.monday.com/v2/");
httpWebRequest1.ContentType = "application/json; charset=UTF-8";
httpWebRequest1.Method = "GET";
httpWebRequest1.Headers.Add("Authorization", "API Key");
httpWebRequest1.GetResponse();
var datapull = @"{""query"":""query {boards (ids: 1234) {name state items{id name column_values{text} }}}""";

using (var streamWriter = new StreamWriter(httpWebRequest1.GetRequestStream()))
{
streamWriter.Write(datapull);
Console.WriteLine(datapull);
}

var httpResponse1 = (HttpWebResponse)httpWebRequest1.GetResponse();

using (var streamReader = new StreamReader(httpResponse1.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}

I am encountering the following error when I used the code above.

Hello @SriSivaniCharan!


Welcome to the community! We hope you like it here 🤖


Could you please share with us the error you are seeing when running your code? 🙂


Reply