Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created February 12, 2014 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstachl/8963874 to your computer and use it in GitHub Desktop.
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.
try {
DeskClient client = new DeskClient(new Map<String, String>{
'username' => 'you@example.com',
'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