500 Internal Server Error For Leads API | Community
Skip to main content

500 Internal Server Error For Leads API

  • November 23, 2023
  • 2 replies
  • 0 views

Hi,
I can successfully retrieve all the leads on Postman using the following C# code, however when running this in a development environment, I receive a 500 Internal server error. Despite endless searching, I have yet to find a possible solution. Any suggestions?

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.getbase.com/v2/leads");
request.Headers.Add("Authorization", "Bearer [Token Here]");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Thanks

 

2 replies

Greg29
  • November 27, 2023

Hi Stephen! It's difficult to say what could be causing this issue with the information provided. I would recommend reaching out to our Advocacy team so that they can check the logs for your account and see if they can glean additional information. If it does end up being an issue with your code, drop me an update here and I'll see what I can do to help!


  • Author
  • November 28, 2023

Hi,
After looking at the headers being passed by Postman, I realised that I need to send an additional header when making the request;

request.Headers.Add("User-Agent", "[Value here]");

All now works as expected.