# Connect to an external API using http binding

**URL:** <https://forum.inductiveautomation.com/t/connect-to-an-external-api-using-http-binding/88829>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 15, 2024, 4:10pm UTC](https://forum.inductiveautomation.com/t/connect-to-an-external-api-using-http-binding/88829 "2024-04-15T16:10:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitris\_Kritikos](https://avatars.discourse-cdn.com/v4/letter/d/9fc29f/32.png) [@Dimitris\_Kritikos](https://forum.inductiveautomation.com/u/Dimitris_Kritikos)\
**Post date:** [April 15, 2024, 4:10pm UTC](https://forum.inductiveautomation.com/t/connect-to-an-external-api-using-http-binding/88829/1 "2024-04-15T16:10:52Z")

</div>

Hi community!  
I'm very new with Perspective and one of the first things we try to do in our project is to connect to an external API and retrieve data, so I can store it to my DB.  
I have tried to connect following some examples online, but without success.

 ![http_binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/effb68275e6b361c2176a1036c96f188e2df5cf4.png)  
Based on what you see on the photo, config, and error message, is it because of my config or something with the API? Any ideas, please share!

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 15, 2024, 4:29pm UTC](https://forum.inductiveautomation.com/t/connect-to-an-external-api-using-http-binding/88829/3 "2024-04-15T16:29:19Z")

</div>

A 403 just means that the server you're talking to doesn't like your attempt to authenticate. Are you sure it wants you to pass an `X-Api-Key` header? Are you sure your header is valid? Do you have documentation for the API you're trying to access?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 15, 2024, 4:33pm UTC](https://forum.inductiveautomation.com/t/connect-to-an-external-api-using-http-binding/88829/4 "2024-04-15T16:33:37Z")

</div>

If you are going to be storing to a DB, you likely don't want to use a binding in your user interface. Consider using the scripted `system.net.httpClient()` in a gateway event. Or explain **when** you want this to happen.
