Trouble Installing Developer App - Bad Auth Code


Hi all,

I’m trying to install my developer application into my company’s Hubspot portal, I’m near the end of the process to complete the OAUTH flow however I’m having an issue that is preventing me from getting the access token. I’m using Postman to construct the request and I keep receiving this response:

{“status”:“BAD_AUTH_CODE”,“message”:“missing or unknown auth code”,“correlationId”:“4c05bb8b-5a2f-4646-bc18-074356cdc252”,“requestId”:“d4f849d1ab68c703ee9e7d690abecd90”}

The request is being made to:

The client secret/ID are correct and I’m using the correct code received after visiting the link below and being redirected to the home page. (Client ID hidden on purpose… don’t know if I should do that or not).

Is there a step I’m missing somewhere?

Thanks for the help!


@KodyWright How are you formatting the call? Maybe you are not passing in the code correctly? Can I see an example of your call in postman?


Sure thing, here’s the full code being sent.

POST /oauth/v1/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: 5c0ec2bf-36c5-ded0-9998-16da75a46361



If you need I can paste the info with ID, secret and code. Not sure what all I should hide on these forums.


@KodyWright Nothing jumps out at me looking at that. Are you doing the second call right after the first? As the code can expire. About half way down this forum I share photos of what it looks like in postman to make the call.


Odd, but I switched from sending data in raw format to form-url-encoded (like the image you attached) and it worked perfectly. Thanks for the help! I really appreciate it.


@pmanca What is included in the header in “Postman” because when i run my app its again giving BAD_AUTH_CODE error you have included the correct part in body section but the two statements given in the header was not shown kindly share that in a same way e.g Image. Thanks


@Umar_Jamil The link above has images to both the body and the headers. If you are having any trouble still, please start a new thread.


@pmanca Kindly include the image of header as well. The body section is fine but its producing the same error.


@Umar_Jamil The headers are in an image posted in the link above. Please review the other thread.


@pmanca See the output with the same header and body as you told.


@pmanca Thanks for the help! I really appreciate it. its work for me.


@Umar_Jamil i’m glad you got it working. Let us know if you run into anything else.


how could you share the code please