Getting 404, 502 and 504 error from API at the first time then success after retry | Community
Skip to main content

My context:
API version: 2.12
API call: search and update contact

404 Curl request at 2025-03-31 09:50:33
 

{
"headers": {
"content-length": "74",
"user-agent": "GuzzleHttp/7",
"host": "api.intercom.io",
"authorization": "********",
"accept": "application/json",
"content-type": "application/json"
},
"body": "{\"query\":{\"field\":\"external_id\",\"operator\":\"=\",\"value\":\"vegastars_78859\"}}",
"url": "https://api.intercom.io/contacts/search",
"method": "POST"
}

Here is the response at 2025-03-31 09:50:33:

I have double-checked that the value exists in Intercom. However, the weird thing is that when my server calls the API, it returns an error response. Then, when the request is retried by the queue, it succeeds.
I want to make sure that are these response such as 404 and 502, 504 coming from your side ?

{
"body": "<html><head><title>404 Not Found</title></head><body><center><h1>404 Not Found</h1></center><hr><center>nginx</center></body></html>",
"method": 404
}

Also the 502 and 504 error are the same:
502 Curl request at 2025-04-01 18:23:44

{
"headers": {
"content-length": "74",
"user-agent": "GuzzleHttp/7",
"host": "api.intercom.io",
"authorization": "********",
"accept": "application/json",
"content-type": "application/json"
},
"body": "{\"query\":{\"field\":\"external_id\",\"operator\":\"=\",\"value\":\"vegastars_80822\"}}",
"url": "https://api.intercom.io/contacts/search",
"method": "POST"
}

Here is the response at 2025-04-01 18:23:45

{
"body": "<html><head><title>502 Bad Gateway</title></head><body><center><h1>502 Bad Gateway</h1></center><hr><center>nginx</center></body></html>",
"method": 502
}

504 Curl request at 2025-03-30 09:20:59

{
"headers": {
"content-length": "74",
"user-agent": "GuzzleHttp/7",
"host": "api.intercom.io",
"authorization": "********",
"accept": "application/json",
"content-type": "application/json"
},
"body": "{\"query\":{\"field\":\"external_id\",\"operator\":\"=\",\"value\":\"vegastars_78747\"}}",
"url": "https://api.intercom.io/contacts/search",
"method": "POST"
}

Here is the response at 2025-03-30 09:21:09

{
"body": {
"type": "error.list",
"errors": "
{
"code": "service_unavailable",
"message": "Sorry, the API service is temporarily unavailable"
}
]
},
"method": 504
}


Version of API is invalid Curl request at 2025-03-24 15:42:08

{
"headers": {
"content-length": "40",
"user-agent": "GuzzleHttp/7",
"host": "api.intercom.io",
"authorization": "********",
"accept": "application/json",
"content-type": "application/json"
},
"body": "{\"custom_attributes\":{\"ngr\":23.2456113}}",
"url": "https://api.intercom.io/contacts/67d934eafa85f32d461da27d",
"method": "PUT"
}

Here is the response at 2025-03-24 15:42:09

{
"body": "{\"type\":\"error.list\",\"request_id\":\"0002uc5vom1vj3ff1oq0\",\"errors\":s{\"code\":\"intercom_version_invalid\",\"message\":\"Requested resource is not available in current API version\"}]}",
"method": 400
}

 


@cooldev It’s Mat from the Support Engineering Team 😀

Can you test these API calls with the latest API version 2.13? Is the issue still persists? 

If yes, can you reach out to us and send us the request ID of each action you did that failed so we can check our logs to see what had happened there?


Reply