Quote Machine Challenge

The key is embedded in the code, the first line. You should be able to hit run and after a few seconds it outputs your quote to the console. Be sure to hit “EDIT ON CODEPEN” so you can see it in its own window.

To use this code, just cut and paste into your pen and switch the key to your key. The code is this:

var API_KEY = "your-api-key-goes-here";

$.ajax({
  url: 'https://andruxnet-random-famous-quotes.p.mashape.com/cat=famous',
  type: 'POST',
  data: {},
  dataType: 'json',
  beforeSend: function(xhr) {
    xhr.setRequestHeader("X-Mashape-Authorization", API_KEY);
  },
  success: function(data) { 
    console.log("Success!..."); 
    console.log(data);
  },
  error: function(err) { 
    console.log("Failure!..."); 
    console.log(err); 
  }
});