# Web API - NetworkError when attempting to fetch resource

**URL:** https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597
**Category:** Questions about Thunkable X
**Created:** [May 2, 2020, 5:53pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597 "2020-05-02T17:53:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![dougsouzarodrigues5m](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dougsouzarodrigues5m/32/68449_2.png) [@dougsouzarodrigues5m](https://community.thunkable.com/u/dougsouzarodrigues5m)
#### Post date: [May 2, 2020, 5:53pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/1 "2020-05-02T17:53:58Z")

</div>

Hello, guys.  
I’m trying to integrate my app to the SPTrans (a public transportation company) in order to get the public buses’ real time position.  
I’m using the Web API component to call a GET method but its returns an error: NetworkError when attempting to fetch resource.

Anyone knows how can I solve this error?

---

<div class="post-metadata">

### Author: ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)
#### Post date: [May 2, 2020, 6:02pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/2 "2020-05-02T18:02:53Z")

</div>

Hi @dougsouzarodrigues5m, welcome to the Community.

Does this API return information when you paste the link into a browser such as Google Chrome?

---

<div class="post-metadata">

### Author: ![dougsouzarodrigues5m](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dougsouzarodrigues5m/32/68449_2.png) [@dougsouzarodrigues5m](https://community.thunkable.com/u/dougsouzarodrigues5m)
#### Post date: [May 2, 2020, 6:12pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/3 "2020-05-02T18:12:04Z")

</div>

Hello @eoinparkinson, thanks.

On a browser it returns “Authorization has been denied for this request.”

After some tries I decided using Postman to see what shloud be returned and using Postman it return the buses positions correctly as listed a little sample bellow:

{  
“hr”: “15:06”,  
“vs”: [  
{  
“p”: “31528”,  
“a”: true,  
“ta”: “2020-05-02T18:06:30Z”,  
“py”: -23.544581,  
“px”: -46.593377000000004  
}  
]  
}

---

<div class="post-metadata">

### Author: ![eoinparkinson](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/eoinparkinson/32/143769_2.png) [@eoinparkinson](https://community.thunkable.com/u/eoinparkinson)
#### Post date: [May 2, 2020, 6:33pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/4 "2020-05-02T18:33:03Z")

</div>

How did you get the data through Postman if it was denied through browser? Do you have an authKey of some description for this to work?

Web API will display what the browser displays (when accessing API). So if the browser is showing Authorisation denied then this would reflect also onto the Web API.

---

<div class="post-metadata">

### Author: ![ringraith2](https://avatars.discourse-cdn.com/v4/letter/r/9f8e36/32.png) [@ringraith2](https://community.thunkable.com/u/ringraith2)
#### Post date: [May 2, 2020, 6:42pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/5 "2020-05-02T18:42:44Z")

</div>

I’m facing the same error just today aswell. Cannot continue coding with this “bug” happening… Is this really a bug? First time happenning to me.

---

<div class="post-metadata">

### Author: ![dougsouzarodrigues5m](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/dougsouzarodrigues5m/32/68449_2.png) [@dougsouzarodrigues5m](https://community.thunkable.com/u/dougsouzarodrigues5m)
#### Post date: [May 2, 2020, 6:53pm UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/6 "2020-05-02T18:53:55Z")

</div>

On Postman I was passing one URL like this: [http://api.olhovivo.sptrans.com.br/v2.1/Posicao/Linha?codigoLinha=33170](http://api.olhovivo.sptrans.com.br/v2.1/Posicao/Linha?codigoLinha=33170) and works.

I got it make it on Thunkable now.  
This is an interesting behave to me and I don’t know if it happens with other APIs but even I passing the Authorization token on the header I’ve had to call a POST method passing the token again and then inside the POST method call a GET method to list the buses’ position. On this way works for me on Thunkable.

The blocks structure is:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/6/7675259bae2a8ed357b1ab2103c061a3d4f535a6.png)

Sure, this is just for testing the connection and now I’ll deeper and getting the lat and long positions and put them on a map.

Thanks for you help.

---

<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:29am UTC](https://community.thunkable.com/t/web-api-networkerror-when-attempting-to-fetch-resource/564597/7 "2024-11-08T11:29:33Z")

</div>


