Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
Add Comment
Please, Sign In to add comment