Hi i was following the below link " Get Management API Access Tokens for Production "
var client = new RestClient(“https://YOURDOMAIN/oauth/token”);
var request = new RestRequest(Method.POST);
request.AddHeader(“content-type”, “application/x-www-form-urlencoded”);
request.AddParameter(“application/x-www-form-urlencoded”, “grant_type=client_credentials&client_id=%24%7Baccount.clientId%7D&client_secret=YOUR_CLIENT_SECRET&audience=https%3A%2F%2F%24%7Baccount.namespace%7D%2Fapi%2Fv2%2F”, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
I tried to get the token from a console app.
below is the error I get
Error : {“error”:“access_denied”,“error_description”:“Unauthorized”}
when i try from fiddler sometimes it gives me the same error or other wise it is 410 Gone.
Your request looks good. Just to confirm, is your application a machine-to-machine (M2M) application that has been authorized to use your tenant’s management API?
After a failed request, do you see an associated tenant log (from your Auth0 dashboard, Monitorig > Logs)? The logs will sometimes provide additional information which indicate what went wrong with the request.
You could also try testing from your terminal using cURL using the commands in the guide to see if you still get an error.