Quotes

유료
분류별 timshim | 업데이트됨 1ヶ月前 | Education
Health Check

N/A

모든 토론으로 돌아가기

Missing Missing Mashape application key - Quotes API

Rapid account: Nandot
Nandot
8年前

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;
}

Rapid account: Nandot
Nandot Commented 8年前

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

Rapid account: Timshim
timshim Commented 8年前

Try using a GET instead of a POST.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입