Generate OAuth 2.0 Access Token Programatically



I would like to add an event on a user's timeline whenever the complete our registration flow (ie. "User completed registration"). As per the documentation, this requires an OAuth token.

Because we are adding the event to our user's timeline when they register, we would be the "user" going through the OAuth process to grant the access token. Since we would like to this automatically, my question is:

How can we generate an OAuth 2.0 access token programmatically? (without any user input).

This question appears to have been asked here: "HubSpot Access Token", but without a concrete response. This post seems to suggest that the access token cannot be generated programmatically, but that would surprise me.



Create a refresh token manually once and store it. Use that refresh token to generate access token programmatically every time.


Hey @galenweber @Karthick_Shiva , thanks for jumping in here Karthick! We just published a doc that links to a github repo mainly for getting one up and running quickly with Oauth, but also inherently shows how one would programmatically generate access tokens etc. I'd recommend checking out the article here: and the app which is written in Node.js here: Note: this doesn't mean there will be 0 user input -- somebody must confirm your app being installed into their portal, but this takes out much of the legwork that OAuth 2.0 requires. Hope you find it useful :slight_smile: