# API Integration in Angular Application

**URL:** <https://community.hubspot.com/t/api-integration-in-angular-application/56711>\
**Category:** APIs & Integrations\
**Created:** [May 11, 2022, 12:44pm UTC](https://community.hubspot.com/t/api-integration-in-angular-application/56711 "2022-05-11T12:44:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandrakanthake](https://avatars.discourse-cdn.com/v4/letter/c/9fc348/32.png) [@chandrakanthake](https://community.hubspot.com/u/chandrakanthake)\
**Post date:** [May 11, 2022, 12:44pm UTC](https://community.hubspot.com/t/api-integration-in-angular-application/56711/1 "2022-05-11T12:44:33Z")

</div>

I want to call Contacts API. I have integrated it with my angular application. I am getting a response with 200 status but also getting CORS error though I have set ‘Access-Control-Allow-Origin’ to ‘\*’.

---

<div class="post-metadata">

**Author:** ![LMeert](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/lmeert/32/103847_2.png) [@LMeert](https://community.hubspot.com/u/LMeert)\
**Post date:** [May 11, 2022, 2:17pm UTC](https://community.hubspot.com/t/api-integration-in-angular-application/56711/2 "2022-05-11T14:17:32Z")

</div>

Hi @chandrakanthake,

Had this problem a while ago ?

If I understand correctly, you’re trying to make an API call from the web client ?

If so that won’t work, whatever you set the ‘Access-Control-Allow-Origin’ to, [see Hubspot’s documentation](https://legacydocs.hubspot.com/docs/faq/do-hubspot-apis-support-ajax-request) :

_For the most part, the HubSpot APIs do not support cross-origin (CORS) AJAX requests. Making the request client-side using JavaScript would expose any authentication you’re using for the request. In order to use JavaScript/AJAX, you would need to make the request (excluding any authentication) to an external server that could then add the needed authentication and make requests to HubSpot’s APIs server-side._

_The exceptions to this rule are:_

- _The [Submit form data (AJAX)](https://developers.hubspot.com/docs/methods/forms/submit_form_ajax) endpoint, which accepts CORS AJAX form submissions._
- _Most GET requests for published HubDB tables. See the [HubDB API Overview](https://legacydocs.hubspot.com/docs/methods/hubdb/hubdb_overview?hsLang=en) for more details._

Also confirmed by [this solution to another post](https://community.hubspot.com/t5/APIs-Integrations/CORS-issue/m-p/304553).

I don’t think anything has changed in this regard.

Hope this helps !  
If it does, please consider marking this answer as a solution 🙂

Best,

Ludwig
