# Configuring Oauth flow

**URL:** <https://community.hubspot.com/t/configuring-oauth-flow/89372>\
**Category:** APIs & Integrations\
**Tags:** webhooks\
**Created:** [September 11, 2023, 3:53pm UTC](https://community.hubspot.com/t/configuring-oauth-flow/89372 "2023-09-11T15:53:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HImran8](https://avatars.discourse-cdn.com/v4/letter/h/dec6dc/32.png) [@HImran8](https://community.hubspot.com/u/HImran8)\
**Post date:** [September 11, 2023, 3:53pm UTC](https://community.hubspot.com/t/configuring-oauth-flow/89372/1 "2023-09-11T15:53:54Z")

</div>

Hi, i’m trying to get the oauth flow working but getting error while trying to obtain initial access and refresh token, below is my curl request. can someone please help out and let me know what i’m doing wrong

curl --location ‘[https://api.hubapi.com/oauth/v1/token](https://api.hubapi.com/oauth/v1/token)’ \  
--header ‘Content-Type: application/x-www-form-urlencoded’ \  
--data-urlencode ‘grant\_type=authorization\_code’ \  
--data-urlencode ‘code=mycode’ \  
--data-urlencode ‘redirect\_uri=localhost:3000’ \  
--data-urlencode ‘client\_id=myclientid’ \  
--data-urlencode ‘client\_secret=myclientsecret’

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [September 13, 2023, 2:37am UTC](https://community.hubspot.com/t/configuring-oauth-flow/89372/2 "2023-09-13T02:37:51Z")

</div>

Hi @HImran8 👋

Try updating your redirect\_uri to include HTTP/S protocol. For example:

…

--data-urlencode ‘redirect\_uri=[http://localhost:3000](http://localhost:3000)’ \

…

Based on my testing, that should do the trick.

I hope this proves useful. Please let me know if you have any follow-up questions.
