"status":"BAD_AUTH_CODE","message":"missing or unknown auth code"
I am trying yo get accesstoken using httpclient using post method but end up with errors. What should i pass for grant_type and what is code parameter can this be a random number , i have given my java code below
"status":"BAD_AUTH_CODE","message":"missing or unknown auth code"
I'm not sure, but I'm guessing that you're not really answering the question Derek_Gervais and I'm also guessing that Vivek_Shankar_S has a similar problem as we have.
In an api to api communication, you can't have users login to HS. The fact that a form is submitted to HS shouldn't be known to the user because it makes the app confusing. I would expect to be able to fully authorize a user with OAuth using pure GET/POST json requests/responses and thus bypassing any HS html page.
I make this call:
POST https://api.hubapi.com/oauth/v1/token Content-Type: application/x-www-form-urlencoded grant_type=authorization_code&client_id=<my client id>&client_secret=<my client secret>&redirect_uri=<my redirect which is useless to me>&code=<the code I only know how to get after a user logs in>
The last part of the above params is the problem i.e. the "code" because the user has to "manually" login to HS. This is a show stopper for our application as it's a PWA and we cannot (for useability reasons) venture outside of our domain. The whole process need to be headless communication.
"status":"BAD_AUTH_CODE","message":"missing or unknown auth code"
Hi @lachlan, when you follow the Installation link from the application and accept the permissions if you sent it to "Local Host" it'll redirect you with a code associated:-