Recent searches


No recent searches

500 Internal server error in Leads API



Posted Jun 14, 2023

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. 


0

3

3 comments

image avatar

Christopher Kennedy

Zendesk Developer Advocacy

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

0


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.

1


image avatar

Greg Katechis

Zendesk Developer Advocacy

Thanks for sharing that Matthew!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post