Quotes

भुगतान किया गया
द्वारा timshim | अपडेट किया गया एक वर्ष पहले | Education
सभी चर्चाओं पर वापस जाएं

Missing Missing Mashape application key - Quotes API

N
Nandot
7 वर्ष पहले

Getting the following response message
{“message”:“Missing Mashape application key. Go to http://docs.mashape.com/api-keys to learn how to get your API application key.”} from my javascript function

I’m not sure if I’m formatting the header data wrong or what the deal is, any pointers are appreciated

function getQuote(){
var request = new XMLHttpRequest();
request.open(“POST”, “https://timshim-quotes-v1.p.mashape.com/quotes”, false);
request.setRequestHeader(“Content-type”,“X-Mashape-Key: KEY_GOES_HERE”,“Accept: application/json”);
request.send();
txtOutput.value = request.responseText;
}

N
Nandot commented 7 वर्ष पहले

Hi,

I changed my call to GET as follows:

var request = new XMLHttpRequest();
request.open(“GET”, “https://timshim-quotes-v1.p.mashape.com/quotes”, false);
request.setRequestHeader(“Content-type”,“X-Mashape-Key: KEY GOES HERE”,“Accept: application/json”);
request.send();
txtOutput.value = request.statusText;

The “request.statusText” now shows as Unauthorized

Do I need to pass the application name I used when I requested my key? Any other pointers are approaciated.

Regards

avatar
timshim commented 7 वर्ष पहले

Try using a GET instead of a POST.

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें
रेटिंग: 5 - वोट: 1