# CORS issue

**URL:** <https://community.hubspot.com/t/cors-issue/57933>\
**Category:** APIs & Integrations\
**Created:** [May 29, 2022, 6:54am UTC](https://community.hubspot.com/t/cors-issue/57933 "2022-05-29T06:54:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NUdayakumar](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@NUdayakumar](https://community.hubspot.com/u/NUdayakumar)\
**Post date:** [May 29, 2022, 6:54am UTC](https://community.hubspot.com/t/cors-issue/57933/1 "2022-05-29T06:54:30Z")

</div>

Hello All,

We have an React Application calling the Contacts API via AWS Lambda since we were getting CORS issue while trying to access the API directly from React APP. But even after implementing a AWS Lambda function we are still getting the same CORS error. This is really urgent can anyone please help. The error

Access to XMLHttpRequest at ‘[https://devapi.ourdomain.com/crm/](https://devapi.ourdomain.com/crm/)’ from origin ‘[http://localhost:3000](http://localhost:3000)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [May 30, 2022, 11:38pm UTC](https://community.hubspot.com/t/cors-issue/57933/2 "2022-05-30T23:38:30Z")

</div>

@stefen , what are you thinking 😀

---

<div class="post-metadata">

**Author:** ![stefen](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stefen/32/29274_2.png) [@stefen](https://community.hubspot.com/u/stefen)\
**Post date:** [May 31, 2022, 12:59pm UTC](https://community.hubspot.com/t/cors-issue/57933/3 "2022-05-31T12:59:56Z")

</div>

@NUdayakumar @dennisedson if you’re getting CORS errors its because you are trying to access an API designed for servers from the browser. Can you make the request via node.js on the server instead of via the browser?  
If you have to make the request client side then you’ll want to setup a proxy server similar to what I did here: [How to Enable CORS/AJAX Requests for any HubSpot API](https://www.kelp.agency/blog/how-to-enable-cors-ajax-requests-for-any-hubspot-api)

---

<div class="post-metadata">

**Author:** ![NUdayakumar](https://avatars.discourse-cdn.com/v4/letter/n/3d9bf3/32.png) [@NUdayakumar](https://community.hubspot.com/u/NUdayakumar)\
**Post date:** [June 3, 2022, 7:08am UTC](https://community.hubspot.com/t/cors-issue/57933/4 "2022-06-03T07:08:34Z")

</div>

Hey Guys,  
Thanks for the responses. We were able to solve this by creating an API endpoint and lambda function in AWS. The contact creation is now working and really appreciate the help.  
Thanks,  
Nirmal Kumar

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 9, 2022, 10:48pm UTC](https://community.hubspot.com/t/cors-issue/57933/5 "2022-06-09T22:48:19Z")

</div>

Thanks for the update, @NUdayakumar!
