Created
April 21, 2015 14:50
-
-
Save nfabian13/e261e15d097d73a01bf9 to your computer and use it in GitHub Desktop.
an example how to call the wordnik API using swagger.
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
<script src="~/lib/swagger-client.js" type='text/javascript'></script> | |
<script type="text/javascript"> | |
$(document).ready(function () { | |
// initialize swagger, point to a resource listing | |
window.swagger = new SwaggerClient({ | |
url: "http://api.wordnik.com/v4/resources.json", | |
success: function () { | |
swagger.apis.account.getLoggedInUser({username: 'myusername', password: 'mypass'}, function(data){ | |
alert(data); | |
//document.getElementById("mydata").innerHTML = JSON.stringify(data.obj); | |
}); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment