# I have a problem with Web API

**URL:** <https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273>\
**Category:** Questions about Thunkable X\
**Tags:** beginner\
**Created:** [September 1, 2020, 8:08am UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273 "2020-09-01T08:08:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackratchaburi70120f](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jackratchaburi70120f](https://community.thunkable.com/u/jackratchaburi70120f)\
**Post date:** [September 1, 2020, 8:08am UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/1 "2020-09-01T08:08:37Z")

</div>

Hi,

I’ve tried to get the response from my customer Web API with the blocks depicted below, but the error is always “The website or service provider you are trying to reach does not support HTTPS requests.” (or “undefined” on Live Test). It would be great if someone can help me get through this.

 ![T1-1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/4/e45ffc05dd6c88f84b684c01bb204d638e9096f5.png)  
Thanks in advance.  
Jack.

---

<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:** [September 1, 2020, 11:29am UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/2 "2020-09-01T11:29:32Z")

</div>

Hi,

Test everything only in Live on your devices.

---

<div class="post-metadata">

**Author:** ![jackratchaburi70120f](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jackratchaburi70120f](https://community.thunkable.com/u/jackratchaburi70120f)\
**Post date:** [September 1, 2020, 2:29pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/3 "2020-09-01T14:29:28Z")

</div>

Hi,  
Thanks for your advice. I already did, but it changed the error message from “The website or service provider you are trying to reach does not support HTTPS requests.” to “undefined”.

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [September 1, 2020, 2:43pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/4 "2020-09-01T14:43:02Z")

</div>

@jackratchaburi70120f

Does this api call work in Postman?

---

<div class="post-metadata">

**Author:** ![jackratchaburi70120f](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jackratchaburi70120f](https://community.thunkable.com/u/jackratchaburi70120f)\
**Post date:** [September 1, 2020, 3:44pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/5 "2020-09-01T15:44:16Z")

</div>

Hi Jared,

Yes, I tested it with Postman, VBA, and also [https://reqbin.com/](https://reqbin.com/).  
Here is the code I use to call the API successfully.

Dim xmlhttp As Object  
Dim myurl As String

Set xmlhttp = CreateObject(“WinHttp.WinHttpRequest.5.1”)

myurl = “[http://a.b.c.d/ServiceQuick/ServiceQuick.php?Service=ShowInfo](http://a.b.c.d/ServiceQuick/ServiceQuick.php?Service=ShowInfo)”

xmlhttp.Open “POST”, myurl, False  
xmlhttp.setRequestHeader “Content-Type”, “application/json”

xmlhttp.send “{”“token”":"“xxxx”","“idno”":"“xxxx”"}"

Output = xmlhttp.responseText

Jack.

---

<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:** [September 1, 2020, 4:56pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/6 "2020-09-01T16:56:21Z")

</div>

This means that you are making the request incorrectly. POST in Thuinkable X works well with https when I make different requests.

Look carefully at your blocks. You always display the value of the error block when there is an error and when there is no error. Simply put, the response from the server is not output anywhere.

---

<div class="post-metadata">

**Author:** ![jackratchaburi70120f](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jackratchaburi70120f](https://community.thunkable.com/u/jackratchaburi70120f)\
**Post date:** [September 1, 2020, 10:45pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/7 "2020-09-01T22:45:31Z")

</div>

@actech  
You are absolutely right!  
There are two conditions needed to done at the same time:

1. Test must be done on device only.
2. I did wrong at the status checking.  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![taiskleinoliveira8y3](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@taiskleinoliveira8y3](https://community.thunkable.com/u/taiskleinoliveira8y3)\
**Post date:** [April 27, 2021, 4:21pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/8 "2021-04-27T16:21:15Z")

</div>

Hi there! I am having the same issue with another Web API (Google distance matrix). When I try on live device, it works well. But when I try on web app, it says the same error “the website…”. The problem is that my app will be a web app.

What did you do wrong on status? Because I also put this “If status = 200” block.

---

<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:** [April 27, 2021, 5:23pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/9 "2021-04-27T17:23:33Z")

</div>

This problem is individual to certain APIs. I don’t believe you’re going to be able to force an API that doesn’t work as a web app to work. I don’t understand the technical reasons for this but I’ve come to accept it.

What I did for measuring distances is to use the Haversine formula and create the math for it in Thunkable. It takes a ton of blocks to do but it works really fast and really well.

> [@Calculate distance travelled](https://community.thunkable.com/t/calculate-distance-travelled/565278):
>
> hello, its me again. how does one calculate distance travelled over time on a map in thunkable x? I intend on generating a notification if a certain distance is covered within x amount of time

Tatian

---

<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:24pm UTC](https://community.thunkable.com/t/i-have-a-problem-with-web-api/784273/10 "2024-11-08T12:24:20Z")

</div>


