# BAD\_GRANT\_TYPE on cURL

**URL:** <https://community.hubspot.com/t/bad-grant-type-on-curl/13403>\
**Category:** APIs & Integrations\
**Tags:** oauth\
**Created:** [March 7, 2019, 6:26pm UTC](https://community.hubspot.com/t/bad-grant-type-on-curl/13403 "2019-03-07T18:26:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dougyan12](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dougyan12/32/98942_2.png) [@dougyan12](https://community.hubspot.com/u/dougyan12)\
**Post date:** [March 7, 2019, 6:26pm UTC](https://community.hubspot.com/t/bad-grant-type-on-curl/13403/1 "2019-03-07T18:26:05Z")

</div>

I am having trouble getting my access token when trying to authenticate using OAuth 2.0.

After retrieving a code using a callback URI, I am attempting to make a cURL requst as follows:

```auto
curl \
-H ‘Content-Type:application/x-www-form-urlencoded’ \
-X POST \
-d ‘{ "grant_type":"authorization_code”,\
	”client_id":<client_id>,\
	"client_secret":<client_id>,\
	”redirect_uri":<my_url>,\
	“code":<code>}’\ 
https://api.hubapi.com/oauth/v1/token

```

However, I get the following error:

`{ "status":"BAD_GRANT_TYPE", "message":"missing or unknown grant type", "correlationId":"5e63d42e-46c5-4b03-8168-8b3cd82794e1", "requestId":"b732e441fb093ad8b6d76b9d30a21677"}`

I have tried adding “charset=utf-8” and changing the header type to “application/json” but neither of those solve the issue.

Thank you!

---

<div class="post-metadata">

**Author:** ![dougyan12](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dougyan12/32/98942_2.png) [@dougyan12](https://community.hubspot.com/u/dougyan12)\
**Post date:** [March 7, 2019, 11:54pm UTC](https://community.hubspot.com/t/bad-grant-type-on-curl/13403/2 "2019-03-07T23:54:45Z")

</div>

I figured out the issue. I was writing out my cURL requests into a notepad application, and it was autocorrecting my single quotes from straight quotes ( ’ ) into curvy quotes ( ’ ) and this was causing the command to be mis-interpreted.
