Skip to main content

Hi I created a simple get method in C# using APIKey as per Unbounce API doc, I am not getting any response data, Kindly suggest,Thank you

 

 using (var httpClient = new HttpClient())
            {
                using (var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.unbounce.com/pages/{Page-id}/leads?secure=true&limit=1000"))
                {
                    request.Headers.TryAddWithoutValidation("Accept", "Accept: application/vnd.unbounce.api.v0.4+json");

                    var base64authorization = Convert.ToBase64String(Encoding.ASCII.GetBytes("APIKEY:"));
                    request.Headers.TryAddWithoutValidation("Authorization", $"Basic {base64authorization}");

                    var response = await httpClient.SendAsync(request);

      var JsonString = await response.Content.ReadAsStringAsync();
                }
            }

Be the first to reply!

Reply