OAuth2 Questions about state and correlationId


#1

Do you have an example of how to use state with the OAuth2 implementation?

I tried something like this:
https://app.hubspot.com/oauth/authorize?client_id=[client_id]&scope=contacts%20automation&state=555&redirect_uri=https://www.hubspot.com

and got back something like this:

But I cannot seem to use it on subsequent messages - specifically within the contacts API.

Also, do you have any information on how to use the correlationId that is returned from API calls?

Thanks,
P Smith


Integration with OAuth 2.0
#2

Hi @psmith

The state parameter won’t have any meaning to HubSpot, it’s only be used by your server to verify the user in your system:

As far as accessing the APIs, you’d need to use the code parameter you get in the redirect URL to generate an access token, then use that access token to authenticate with our APIs.