# Quickstart fail

**URL:** <https://community.auth0.com/t/quickstart-fail/82649>\
**Category:** Get Help\
**Created:** [April 29, 2022, 2:51pm UTC](https://community.auth0.com/t/quickstart-fail/82649 "2022-04-29T14:51:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![h3llo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/h3llo/32/13404_2.png) [@h3llo](https://community.auth0.com/u/h3llo)\
**Post date:** [April 29, 2022, 2:51pm UTC](https://community.auth0.com/t/quickstart-fail/82649/1 "2022-04-29T14:51:27Z")

</div>

Using the Getting an access token for your API quickstart, the cURL command:

```auto
curl --request POST \
  --url https://xxxxx.eu.auth0.com/oauth/token \
  --header 'content-type: application/json' \
  --data '{"client_id":"xxxxx","client_secret":xxxx-xxxx","audience":"https://xxxx.eu.auth0.com/api/v2/","grant_type":"client_credentials"}'

```

fails with an invalid json response…  
The above is copied directly from the quickstart (with the obvious change in the credentials). So, what’s wrong?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 29, 2022, 3:04pm UTC](https://community.auth0.com/t/quickstart-fail/82649/3 "2022-04-29T15:04:12Z")

</div>

Hi @h3llo,

Welcome to the Auth0 Community!

As the error says, your JSON is invalid. You are missing a quote in your `client_secret` value.

Sometimes it’s helpful to write your JSON in a code editor like VS code which can help to validate the data’s formatting.

---

<div class="post-metadata">

**Author:** ![h3llo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/h3llo/32/13404_2.png) [@h3llo](https://community.auth0.com/u/h3llo)\
**Post date:** [April 29, 2022, 5:33pm UTC](https://community.auth0.com/t/quickstart-fail/82649/4 "2022-04-29T17:33:42Z")

</div>

hmm no, that was me removing the actual secret and taking the quote, but nm. I will look at another solution instead.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 29, 2022, 5:58pm UTC](https://community.auth0.com/t/quickstart-fail/82649/5 "2022-04-29T17:58:37Z")

</div>

@h3llo - Which quickstart are you working off of?

According to [Get Access Tokens](https://auth0.com/docs/secure/tokens/access-tokens/get-access-tokens) the `content-type` should be `x-www-form-urlencoded` rather than `application/json` like:

```auto
curl --request POST \
  --url 'https://YOUR_DOMAIN/oauth/token' \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id=YOUR_CLIENT_ID \
  --data client_secret=YOUR_CLIENT_SECRET \
  --data audience=YOUR_API_IDENTIFIER

```

Does that help at all?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [April 29, 2022, 6:07pm UTC](https://community.auth0.com/t/quickstart-fail/82649/7 "2022-04-29T18:07:49Z")

</div>

@h3llo,

Gotcha, that was just the first thing I noticed and would have returned that same error.

Can you try what @ty.frith mentioned and let us know if that works?

Additionally, can you please post a link to the doc you got this code snippet from? If there is an issue with the doc I’d like to update it.

Thanks

---

<div class="post-metadata">

**Author:** ![h3llo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/h3llo/32/13404_2.png) [@h3llo](https://community.auth0.com/u/h3llo)\
**Post date:** [April 29, 2022, 8:00pm UTC](https://community.auth0.com/t/quickstart-fail/82649/8 "2022-04-29T20:00:53Z")

</div>

Thanks for the info.  
I was working off the ‘API Explorer Application’ quickstart. Was having trouble getting the C# quickstart to work and then the cURL version.

cURL was a GitBash fail when I looked closer, which I resolved.  
However, I was struggling for ages with the C# quick start.  
For those who come upon it and wonder what the heck (or maybe that was just me) lol…

The RestClient in the quickstart is deprecated. Latest version (107.x) does not use synchronous calls or any of the Header/Parameter settings. Also it no longer will return a IRestResponse.  
[[https://restsharp.dev/intro.html#introduction](https://restsharp.dev/intro.html#introduction)]

Below is my working version using async if it helps anyone:

```auto
var client = new RestClient("https://YOUR_AUTH0_DOMAIN");

var request = new RestRequest("oauth/token", Method.Post);

request.AddStringBody("{\"client_id\":\"YOUR_CLIENT_ID\",\"client_secret\":\"YOUR_CLIENT_SECRET\",\"audience\":\"https://YOUR_API.eu.auth0.com/api/v2/\",\"grant_type\":\"client_credentials\"}", DataFormat.Json);

var response = await client.ExecuteAsync(request);

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [June 28, 2022, 10:31pm UTC](https://community.auth0.com/t/quickstart-fail/82649/9 "2022-06-28T22:31:00Z")

</div>


