APIs & Integrations

ElliePaige
Participant

Creating a workflow based on an API trigger

SOLVE

Hi, We are wanting to start a workflow based on an API. This would be to send a password reset email out to the client. Is this possible to do and if not, what would the workaround be for this please?

Thanks!

0 Upvotes
1 Accepted solution
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Creating a workflow based on an API trigger

SOLVE

@ElliePaige  - My server is usually laravel, so I generate the password reset in my laravel application and then add the value of that generated password reset link to the contact property PASSWORD_RESET_URL by using the HS API.

 

So basically, when you use the HS API to update the contact properties, you will pass

PASSWORD_RESET_URL => url generated from your own server

PASSWORD_RESET_REQUESTED => timestamp()

View solution in original post

6 Replies 6
tjoyce
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Creating a workflow based on an API trigger

SOLVE

@ElliePaige - What I do is create 2 properties on the contact PASSWORD_RESET_URL and PASSWORD_RESET_REQUESTED (both single line text fields). When a user hits the reset password button, the API puts the unique pw reset link into the PASSWORD_RESET_URL and the UTC timestamp into the PASSWORD_RESET_REQUESTED. 

 

Then I create a workflow with the trigger of:

PASSWORD_RESET_REQUESTED -> changes && PASSWORD_RESET_REQUESTED not empty (so you don't send this email when the contact is created)

 

Then let the workflow send your pw reset email with the PASSWORD_RESET_URL variable.

 

I'm sorry, I don't have a solution for you that doesn't require workflows... would love to see you answer your own question if you find a good way to do it without workflows capability

 

 

ElliePaige
Participant

Creating a workflow based on an API trigger

SOLVE

Hi, Thanks for this! 

 

I've created the properites and set up the workflow trigger so that the PASSWORD_RESET_REQUESTED is known. Then within the email itself, how would I include the PASSWORD_RESET_URL variable so that the user can click on the link to reset their password?

 

Thanks

0 Upvotes
tjoyce
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Creating a workflow based on an API trigger

SOLVE

@ElliePaige  - My server is usually laravel, so I generate the password reset in my laravel application and then add the value of that generated password reset link to the contact property PASSWORD_RESET_URL by using the HS API.

 

So basically, when you use the HS API to update the contact properties, you will pass

PASSWORD_RESET_URL => url generated from your own server

PASSWORD_RESET_REQUESTED => timestamp()

ElliePaige
Participant

Creating a workflow based on an API trigger

SOLVE

Thanks for your help. We've set all this up now and are ready to test it.

dennisedson
HubSpot Product Team
HubSpot Product Team

Creating a workflow based on an API trigger

SOLVE

Hey @ElliePaige 

What API would be triggering this workflow?  @tjoyce , with the limited information, do you have any advice?

ElliePaige
Participant

Creating a workflow based on an API trigger

SOLVE

Hi Dennis, thanks for replying back. If a user clicks the 'forgot password' button on our site, we ideally wanted to indlue the API of this to trigger the workflow which includes their details and the link in the email for them to reset their password. However, I've now looked further into this and seen that a webhook or behaviour events can be used, however we don't have enterprise.

 

I think the only workaround at the moment is to use the page view trigger, so once a user has clicked 'forgot password' it leads them to a page that says they'll be getting an email and we use that URL to start the workflow.

 

Unless there is another way?