Skip to content

Instantly share code, notes, and snippets.

@dpawluk
Created January 20, 2017 21:39
Show Gist options
  • Save dpawluk/804b281f5aa7800fffddd81d9f074c07 to your computer and use it in GitHub Desktop.
Save dpawluk/804b281f5aa7800fffddd81d9f074c07 to your computer and use it in GitHub Desktop.
V2 making a request and logging response
<html>
<head>
</head>
<body>
<h2>Test</h2>
<div id="main_view">
</div>
<!-- https://github.com/zendesk/zendesk_app_framework_sdk -->
<script type="text/javascript" src="https://assets.zendesk.com/apps/sdk/2.0/zaf_sdk.js"></script>
<script>
// Initialise the Zendesk JavaScript API client
// https://developer.zendesk.com/apps/docs/apps-v2
var client = ZAFClient.init();
client.invoke('resize', { width: '100%', height: '400px' });
client.on('app.registered', function(){
client.request('/api/v2/users/me.json').then(function(response){
console.log(response);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment