I am having trouble getting started. I have written some code below in C#. I get “The underlying connection was closed: An unexpected error occurred on a send.” which means FreshDesk didn’t like something – but it looks correct according to their documentation. The APIKey is mine and the domain is correct.
What am I doing wrong?
HttpWebRequest req = (HttpWebRequest)WebRequest.Create($"https://{domain}.freshdesk.com/api/v2/tickets" );
req.ContentType = "application/json";
req.Method = "GET";
req.Timeout = 10000;
string encoded = Convert.ToBase64String(Encoding.GetEncoding("ISO-8859-1").GetBytes($"{myapikey}:X"));
req.Headers.Add("Authorization", $"Basic {encoded}");
WebResponse w = req.GetResponse();