Get data from using API using c#

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

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

             using (var streamWriter = new StreamWriter(httpWebRequest1.GetRequestStream()))

            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 :robot:

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