External POST API call upon saving specific field value in Contacts form

Hello Community,

Could you guys please help me with one problem.

I am looking for some breakthrough to solve my problem with contact form.

My requirement is to use POST API call to send review email to my contact if I set the “reviewmail” field value to “Yes” for any contact. As soon as I save the contact with this updated details, an external API (POST) should be called. My API is working fine but I am not yet able to implement it in hubspot contact form directly. As this is for my Hubspot contacts which are managed in Hubspot only.

Any lead is much appreciated.

Thanks in advance!!

@ankurchauhan

Would you be willing to go into more detail? Perhaps an example?

I have a feeling webhooks will be involved in the solution, but I am not 100% clear, yet.
@RMones :waving_hand: Happy new year! Any thoughts?

@dennisedsonThanks for response.

The whole scenerio is as follows:

I have a created a custom field (Single Checkbox) in contact form. And upon setting the value to True for this field for any contact, an External API (Grab Your Review POST API to send email for review) should send an email to the email id of this contact person.

The external API is : https://api.grabyourreviews.com/review_invitation

This API is basically a POST API request which sends email to the email address given in the body.

I hope this makes sense. Please let me know if something else is required for better explanation.

Cool.

So I think I was correct with webhooks.

What I am thinking is that you will subscribe to a new/change event for that custom field.

Once that field is changed in a contact object, it will send a webhook package to your app. At that point, you app does its thing which would start with an API call to the contacts endpoint to get the email address associated with the ID. You might need to add some logic in case someone changes the boolean on the backend to false because that would be considered a change as well.

Some docs to get you going

Webhooks

Contacts API

@dennisedsonBy an App, you mean Hubspot App?

if yes, could you please help me with some proper documentation about an app for API call as I tried that but could not find much info like oAuth, Redirect URI etc.

yeah @ankurchauhan

You will want to create a developer account and within that, create an app. Consider this app your intermediary between HubSpot and your external service. You will set up your OAuth as well as the webhook through this.

This doc should get you going. There is a link in there at the beginning for setting up an developer account as well. Heck, if your service is amazing, you could sell it on the marketplace :money_mouth_face:

@dennisedson Many Thanks for the lead!!

Happy New Year :grinning_face_with_smiling_eyes:

@dennisedsonHey again.

Advance apology (for probably a stupid question)

I am very new to Hubspot App. I have created my hubspot app. But I am confused what should be my “redirect URI”?

I want to connect this app with my hubspot account but if I enter something like “app.hubspot.com/auth-callback”, then after using my authorization URL first I get an option to connect my accoun. And after choosing the account, it gives error “That page is nowhere to be found”.

I am here not getting how I can redirect my redirect URI to the Contact page of my hubspot account which I am connecting.

And after doing this if I check my connected apps in hubspot account, this app is not available there.

May I request you to please guide me in right direction on this again :face_with_tongue:

@ankurchauhan

The redirect uri will contain the access code so you will need to be able to get that code and exchange for an auth token (they expire so you will be swapping them) So you will want to redirect the user to a page where your app can grab that parameter from the URL