Propublica Api Authenticate Key With Javascript
Sorry if this is a simple question, but I'm trying to send a GET request to the ProPublica API. They gave me a key, but the documentation does not say how to authenticate with this
Solution 1:
Thanks to Amol for the reply, here is a working version that writes to the console. Make sure you have jQuery, or test it in a browser's dev tools on a site that has jQuery.
$.ajax({
url: "https://api.propublica.org/congress/v1/members/senate/RI/current.json",
type: "GET",
dataType: 'json',
headers: {'X-API-Key': 'YOUR KEY HERE'}
}).done(function(data){
console.log(data)
});
Solution 2:
try to used this
$.ajax({
url: "http://localhost/PlatformPortal/Buyers/Account/SignIn",
type: "GET",
dataType: 'json',
headers: {'X-API-Key', 'PROPUBLICA_API_KEY'}
});
Post a Comment for "Propublica Api Authenticate Key With Javascript"