Created
January 20, 2017 21:39
-
-
Save dpawluk/804b281f5aa7800fffddd81d9f074c07 to your computer and use it in GitHub Desktop.
V2 making a request and logging response
This file contains 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
<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