Skip to content

Instantly share code, notes, and snippets.

@chrisbodhi
Last active August 29, 2015 14:15
Show Gist options
  • Save chrisbodhi/ce5f03b609b9a980bc5e to your computer and use it in GitHub Desktop.
Save chrisbodhi/ce5f03b609b9a980bc5e to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="https://www.dropbox.com/s/l6hgjq7mh52o6od/spiceworks-sdk.js?dl=1&raw=1" type="text/javascript"></script>
<script src="https://code.jquery.com/jquery-2.1.3.min.js" type="text/javascript"></script>
<script src="http://d3js.org/d3.v3.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
var card = new SW.Card();
var tix = card.services('helpdesk');
tix.request('tickets').then( function(data){
$.each(data.tickets, function(index, ticket){
$('body').append('<h4>id: ' + ticket.assignee.id + '</h4>'
+ '<h4>name: ' + ticket.assignee.first_name + ' ' + ticket.assignee.last_name + '</h4>'
+ '<h4>role: ' + ticket.assignee.role + '</h4>'
+ '<h4>url: ' + ticket.assignee.url + '</h4>'
);
});
});
});
</script>
</head>
<body>
<h3>&iexcl;Hola mundo!</h3>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment