500 Internal server error in Leads API | Community
Skip to main content

500 Internal server error in Leads API

  • June 14, 2023
  • 3 replies
  • 0 views

So I am creating an API for leads and when I test it in Postman it is working, sharing a SS for that and so later I created php curl code from Postman and when I run that API on my live server and localhost server I receive an error saying "500 Internal Server Error". 

Postman Screenshot:

Server Screenshot: 


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.getbase.com/v2/leads',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

I have shared the code too just not sharing the Token. 
i did some research and found that if you receive this error in ZEndesk then take their help directly so posting this error here. 

3 replies

Hi Omkar,
 
I see you have a ticket open about this.  I'm going to work through the details with you there.

Matthew77
  • July 25, 2024

I know this is a very late response, but I was having the same issue in my C# app. I had to add a UserAgent header to my request to get a 200 response.


Greg29
  • July 26, 2024

Thanks for sharing that Matthew!