How to Use the SendHustle OAuth Webhook API Feature

If you need to let a third-party app know when a SendHustle user has been created — and enable that app to send emails through that user’s Gmail / Google Workspace account using SendHustle — yes, you can do that.
The SendHustle OAuth webhook API feature enables SendHustle to pass back key info about a user account to your app.
Example: Let’s say you’re a nonprofit. You’re building a dashboard that uses the SendHustle API to allow members to send fundraising email campaigns through their own Gmail accounts.
They never sign up for a SendHustle account, never go to the SendHustle website, and don’t install the SendHustle Chrome extension — all of their campaign composing and management happens on your site through your dashboard.
But… your app needs to direct people to OAuth in SendHustle in order for the SendHustle API to send the campaign through that user’s Gmail account.
How to Use the SendHustle Oauth Webhook API Feature
Your app needs to direct its users to the SendHustle OAuth flow by sending them to:
https://gmass.co/oauth/login?webhook=https://whereveryourwebhookislocated.com
That takes the user into the OAuth flow.
On the final SendHustle screen where the account is created, SendHustle makes a webhook call to your URL like this:
https://whereveryourwebhookislocated.com?apikey=yourusersapikey&emailaddress=youruser@gmail.com
Your app can then capture that information, store the user’s SendHustle API key, and use it to send emails through the user’s Gmail account.
Optional parameter: What if you want a user to use a specific email address?
There’s one optional parameter you can send to SendHustle: An email address. In that case, the login URL would look like this:
https://gmass.co/oauth/login?webhook=https://whereveryourwebhookislocated.com&emailaddress=youruser@gmail.com
That will force the Google OAuth process to default to the account you’ve specified.
Without the emailaddress parameter, Google will give the user an option to choose which of their Google accounts to connect.
So this parameter is a useful way to make sure your user stays consistent with the email address they’re using on your platform and when authorizing SendHustle.
An example in action
Here’s an example of this in action.
(I’m using webhook.site for my example. That’s a website that you can use to test webhooks without, you know, having to build a whole sample app.)
I got a unique webhook URL from webhook.site and pasted this URL into a browser.
https://gmass.co/oauth/login?webhook=https://webhook.site/98f3b9e9-d49a-4848-858a&emailaddress=[myemailaddress]
I used the emailaddress parameter to force Google to default to my desired address.

(If I hadn’t specified an email address, Google would’ve given me an option to choose from every one of their accounts known by that browser.)
I gave SendHustle authorization by signing in.

And all the requisite permissions.

I reached the success page from SendHustle. And now going back over to webhook.site, you can see SendHustle passed my API key and email address back.

Your app, in this case, would store the API key and email address to use as part of your dashboard.
More on the SendHustle API
Here’s more about the SendHustle API and using webhooks with SendHustle.
And let us know if you’re building a unique application that’s powered by SendHustle — we’re always interested in hearing about what you’re doing and we just might be able to help you out.
Only SendHustle packs every email app into one tool — and brings it all into Gmail for you. Better emails. Tons of power. Easy to use.
TRY SendHustle FOR FREE
Download Chrome extension - 30 second install!
No credit card required