Skip to content

Instantly share code, notes, and snippets.

@fehguy
Created December 6, 2013 23:43
Show Gist options
  • Save fehguy/7834081 to your computer and use it in GitHub Desktop.
Save fehguy/7834081 to your computer and use it in GitHub Desktop.
Calling wordnik api with swagger-js
var client = require("swagger-client");
client.authorizations.add("key", new client.ApiKeyAuthorization("api_key", "YOUR_KEY", "header"))
var swagger = new client.SwaggerApi({
url: "https://api.wordnik.com/v4/resources.json",
success: function() {
if(swagger.ready === true) {
swagger.apis.word.getDefinitions({word:"cat"},
function(data) {
console.log("got data: " + data.content.data);
}
);
}
}
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment