Created
February 12, 2014 20:28
-
-
Save tstachl/8963874 to your computer and use it in GitHub Desktop.
Shows how you can use the Force.com Desk.com API client to fetch labels from a specific case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
DeskClient client = new DeskClient(new Map<String, String>{ | |
'username' => '[email protected]', | |
'password' => 'your_password', | |
'subdomain' => 'your_subdomain' | |
}); | |
List<Object> labels = (List<Object>)client.getResource('cases').find(3368).get('labels'); | |
// get the count of the labels | |
System.debug(labels.size()); | |
for (Object label : labels) { | |
// get the string value of the label | |
System.debug(String.valueOf(label)); | |
} | |
} catch(Exception e) { | |
System.debug(e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment