How to configure Web API key?

I read several forum posts and watched a couple tutorial videos but I still don’t understand how to properly format a Web API call that requires a key.

Here’s the format I started with:

Screen Shot 2020-01-17 at 7.19.44 AM

I’ve tried replacing ?key with &key, I’ve tried adding headers with “key” or “api_key” or “Authorization” but any of these attempts results in a message that says a key is required.

What is the correct format for using a key? Does it matter what type of key? I obviously don’t know very much about Web APIs despite my reading!

Here’s an example of an API I was trying to access that required a key:

var unirest = require("unirest");

var req = unirest("GET", "https://omgvamp-hearthstone-v1.p.rapidapi.com/info");

req.headers({
	"x-rapidapi-host": "omgvamp-hearthstone-v1.p.rapidapi.com",
	"x-rapidapi-key": "871a5d996emsh391e0aee1fb8b16p17d7e9jsn4b44613f5c20"
});

This depends on the API you are using - there is no such thing as a general way to authenticate with any API. Check their docs.

Best, Chris

Hi @tatiang,

Have you tried this method of setting the query parameters and headers?
https://docs.thunkable.com/web-api#setting-query-parameters-and-headers

I have but I wasn’t sure what property to use for the key. I tried all of the above but without success.

can you show us exactly how are you doing it ? and the message error you recieved when you request the api

Hi @tatiang,

as I mentioned before, you have to check the documentation of the API provider that you want to work with because there is no way of authentication / access that will work with ANY API. From what I could find with a few minutes of research you have to add these two headers at least:


in Thunkable this would look something like this:
Bildschirmfoto 2020-01-26 um 15.40.50

Of course you will also have to replace xxxx with your API key and set the proper API URL (I guess the “https://apiurl?..” in your blocks was just an example? because it can’t work like that).

Best, Chris