I want to get the data from third party app. When i try to get the data through HTTP get request getting System.CalloutException: Read Time out error.
I have checked the endpoint url on browser and can see the data.
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('http://rt4.marcura.com/REST/1.0/search/ticket/?user=salesforce&pass=salesforcepass&query=CX::Team1&format=s&fields=Subject,Queue,CF.{Account%20Name}');
request.setMethod('GET');
request.setTimeout(12000);
HttpResponse response = http.send(request);
// If the request is successful, parse the JSON response.
if (response.getStatusCode() == 200) {
// Deserialize the JSON string into collections of primitive data types.
Map<String, Object> results = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
// Cast the values in the 'tickets' key as a list
List<Object> tickets = (List<Object>) results.get('tickets');
System.debug('Received the following tickets:');
for (Object ticket: tickets) {
System.debug(ticket);
}
}
Kindly advise.