# Set Headers in web API

**URL:** <https://community.thunkable.com/t/set-headers-in-web-api/34929>\
**Category:** Questions about Thunkable X\
**Tags:** webapi\
**Created:** [July 9, 2018, 7:20am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929 "2018-07-09T07:20:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![App\_Careers](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@App\_Careers](https://community.thunkable.com/u/App_Careers)\
**Post date:** [July 9, 2018, 7:20am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/1 "2018-07-09T07:20:09Z")

</div>

Hi Team,

is there a way we can **set headers to web API in Thunkable Cross Platform**? or any workaround to achieve this. Thank you.

---

<div class="post-metadata">

**Author:** ![Red\_Panda](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/red_panda/32/19387_2.png) [@Red\_Panda](https://community.thunkable.com/u/Red_Panda)\
**Post date:** [July 9, 2018, 10:42am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/2 "2018-07-09T10:42:09Z")

</div>

This is only possible in the designer.  
 ![grafik](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/e/ae92bb9b499f040ddb02da0c91275beba262f89f.png)

-Red Panda

---

<div class="post-metadata">

**Author:** ![App\_Careers](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@App\_Careers](https://community.thunkable.com/u/App_Careers)\
**Post date:** [July 10, 2018, 5:20am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/3 "2018-07-10T05:20:07Z")

</div>

Hi Red\_Panda,

Thank you so much for the reply, can we populate this header property value from Local Storage using blocks ? is there any workaround for this.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 10, 2018, 6:21am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/4 "2018-07-10T06:21:11Z")

</div>

Hi,

If you show an example request, I can answer your question.

---

<div class="post-metadata">

**Author:** ![App\_Careers](https://avatars.discourse-cdn.com/v4/letter/a/45deac/32.png) [@App\_Careers](https://community.thunkable.com/u/App_Careers)\
**Post date:** [July 12, 2018, 5:02am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/5 "2018-07-12T05:02:18Z")

</div>

Hi actech,

Thank you for your response, I am unable to post the blocks here but I can explain how it works,

web api url requires authorization header token to Get/Post information, I am storing the authorization token in local storage instead of fetching it at every request. So, when ever an web api call should happen I am fetching the authorization header token from local storage and sending it in headers in web api and this logic works in Thunkable Classic but how to achieve the same logic in Thunkable crossplatform.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [July 12, 2018, 5:19am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/6 "2018-07-12T05:19:39Z")

</div>

If the header line can not be sent as a query parameter (after the ? сharacter), then I see the output only in sending headers via javascript in the WebViewer component. But in this case, there are difficulties with sending the response to the native part.

---

<div class="post-metadata">

**Author:** ![lflfm](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@lflfm](https://community.thunkable.com/u/lflfm)\
**Post date:** [January 23, 2019, 9:40am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/7 "2019-01-23T09:40:28Z")

</div>

A query parameter is not a header…  
Are there any plans to implement setting Web API headers via blocks? Without this Thunkable is useless for anything that might rely on many web API’s that require headers (headers are almost never static, they tend to contain keys and authentication tokens).

---

<div class="post-metadata">

**Author:** ![comfortable](https://avatars.discourse-cdn.com/v4/letter/c/f1d935/32.png) [@comfortable](https://community.thunkable.com/u/comfortable)\
**Post date:** [July 7, 2019, 5:02am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/8 "2019-07-07T05:02:49Z")

</div>

I’m new to APIs altogether - and found out the first day that **lflfm** is very correct.  
I am trying to pull JSON records from a secure server. I was able to use the Design workspace to set the static Content-Type to get my authorization token/key, but now I have no way to use that (volatile) key at run-time. It needs to be used within a couple of minutes in the header KEY PAIR: “Authorization” field.

---

<div class="post-metadata">

**Author:** ![fjp84](https://avatars.discourse-cdn.com/v4/letter/f/db5fbb/32.png) [@fjp84](https://community.thunkable.com/u/fjp84)\
**Post date:** [August 22, 2019, 9:31pm UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/9 "2019-08-22T21:31:09Z")

</div>

Interesting topic. Looking forward to see more info on this.

---

<div class="post-metadata">

**Author:** ![albert](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/albert/32/4077_2.png) [@albert](https://community.thunkable.com/u/albert)\
**Post date:** [August 23, 2019, 12:39am UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/10 "2019-08-23T00:39:42Z")

</div>

The ability to set web API headers and query parameters in blocks was just added in our [most recent release](https://docs.thunkable.com/release-notes).

---

<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, 12:02pm UTC](https://community.thunkable.com/t/set-headers-in-web-api/34929/11 "2024-11-08T12:02:06Z")

</div>


