Building an app with variable redirect urls

Hi!

My customers use HubSpot. I want to build an app that connects their HubSpot account to my own software app. In my Developer Account I have built the Public App with all the necessary Scopes etc.

The question I have what to put in the redirect url because each customer has their own unique URL to their software app.

So when I come to use the Install URL to install the app in their HubSpot account, the Install URL is incorrect for each customer app.

Hello. For the URL, I would suggest building out your own redirect with your own web url. When doing a redirect, you can add a state parameter that containes their specific subdomain or customer id:

?client_id=YOUR_CLIENT_ID
&scope=contacts%20oauth
&redirect_uri=https://yourdomain.com/oauth/callback
&state=customer123
I would then just build out your webapp to :
- Receive the OAuth code and state

- Use the state to look up the customer that is making the request

- Complete the OAuth token exchange
- Redirect the user to their specific instance based on the OAuth exchange and the state provided.
Let me know if this helps! Hope you have a great day!