# How to configure Web API key?

**URL:** <https://community.thunkable.com/t/how-to-configure-web-api-key/413444>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [January 17, 2020, 3:35pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444 "2020-01-17T15:35:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 17, 2020, 3:35pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/1 "2020-01-17T15:35:54Z")

</div>

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](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/0/d02a79f1a70875e145dfe0031080c85fa566b6fc.png)

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:

```auto
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"
});

```

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [January 17, 2020, 4:56pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/2 "2020-01-17T16:56:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [January 17, 2020, 5:24pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/3 "2020-01-17T17:24:18Z")

</div>

Hi @tatiang,

> [@tatiang](#):
>
> I read several forum posts and watched a couple tutorial videos

Have you tried this method of setting the query parameters and headers?

> **[Web APIs Blocks | Thunkable Docs](https://docs.thunkable.com/web-api#setting-query-parameters-and-headers)**

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 17, 2020, 6:42pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/4 "2020-01-17T18:42:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Daniel\_Coglitore](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Daniel\_Coglitore](https://community.thunkable.com/u/Daniel_Coglitore)\
**Post date:** [January 17, 2020, 6:47pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/5 "2020-01-17T18:47:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Chris](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/chris/32/78883_2.png) [@Chris](https://community.thunkable.com/u/Chris)\
**Post date:** [January 26, 2020, 2:55pm UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/6 "2020-01-26T14:55:17Z")

</div>

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:

 ![Bildschirmfoto 2020-01-26 um 15.41.05](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/e/8ed08fae8a5bd80f281f642a9788b6117d90b04c.png)  
in Thunkable this would look something like this:  
 ![Bildschirmfoto 2020-01-26 um 15.40.50](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/c/ace085953ab95ea04e905903a4634e9d20860563.png)

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

Best, Chris

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 11:45am UTC](https://community.thunkable.com/t/how-to-configure-web-api-key/413444/7 "2024-11-08T11:45:52Z")

</div>


