Recent searches
No recent searches
API Error 500 ZenDesk Sell
Posted Jun 04, 2024
When I try to make any simple request from my system to the Sell API I get 500 error
Here's my code on python:
import http.client
conn = http.client.HTTPSConnection("api.getbase.com")
payload = ""
headers = {
'Content-Type': "application/json",
'Accept': "application/json",
'Authorization': "Bearer *************"
}
conn.request("GET", "/v2/deal/custom_fields", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Here's my code on PHP
$ch = curl_init();
$url = "https://api.getbase.com/v2/deal/custom_fields";
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Accept: application/json',
'Authorization: Bearer **********'
]);
$response = curl_exec($ch);
curl_close($ch);
Here's my code on JS:
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
Authorization: 'Bearer ***************'
}
};
fetch('https://api.getbase.com/v2/deal/custom_fields', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
All of the above returns this
<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx</center>
</body>
</html>
that's not an error from my server.
however, the code works good in postman. What I am missing?
0
3
3 comments
Ahsan Amin
Marcel Isaac I am experiencing the same issue. Were you able to find a solution?
0
Marcel Isaac
Ahsan, the error was resolved by specifying the User-Agent header in the request. We were able to identify and fix this issue through trial and error.
0
Ahsan Amin
Marcel Isaac Can you show me? or share any reference?
0