Hola! ¡Tenemos nuestra Comunidad en Español!

Upgraded Zapier zap(s) functionality to include timeline event creation

Hi HS team. I think the vast majority of the world is starting to use things like Zapier to run enterprise workflows and automation and I think everyone agrees that's great for everyone. Unfortunately, there is a key thing missing from the HubSpot CRM zap(s) functionality that I think you should add immediately. We create a lot of zaps for our product and I know they are quick and easy to do.

 

There should be a zap to add an event to a timeline on a contact record. There is already an API event type created and I would be fine using that template to simply post an html message or even plain text if it was too complicated. Zapier has a webhook put capability which would work to call the HS API, but it requires OAuth 2.0 and zapier obviously doesn't handle that.

13 Replies
RoundaboutEd
New Contributor

I second this. I have just spent three hours trying to find a way to do this (including through Zapier). I already use Zapier to auto-create and update contacts from other services, but we NEED to be able to automate adding an activity or note to a contact's timeline in order for us to use HubSpot. I really don't want to go anywhere else, because I'm impressed with the functionality and flexibility of HubSpot, but if I can't figure out how to do this one element, HubSpot is useless to us and we are back to square one with nothing to use at all.

 

I really hope that this happens in short order because I'm going to have to scrap this whole thing and start over if it doesn't.

jxlio
Occasional Contributor

@joeolsen & @RoundaboutEd

I had this problem in the past and figured out how to accomplish this with Zapier.

How To Create a Hubspot Engagement with Zapier:

1. Create your zap with whatever trigger you want, as long as it has the contact’s email address as a variable to use in the next step
2. Use the Hubspot CRM “Find Contact” action to get all the data needed about your contact.
3. Use the Zapier Webhooks “Custom Request” option to create the engagement
4. Set “Method” to “POST”
5. Set “URL” to https://api.hubapi.com/engagements/v1/engagements?hapikey=YOURAPIKEYHERE
6. Set “Data Pass-Through” to “no”
7. Set “Data” with JSON and Zapier variables using the examples/options on the developers page here: https://developers.hubspot.com/docs/methods/engagements/create_engagement (In the example, I create a Note, but this method is great for creating Tasks that include info/data from other platforms)
8. NOTE: Leave out the timestamp in the JSON request body, it will set the timestamp to the time it is created automatically. (If for some reason you want to set the timestamp, make sure it’s in milliseconds or it will make the note appear it was created in the 70’s.)
9. Required fields in the JSON body: ownerId, contactId, body. You can also associate Deals, a Company, and other Hubspot owners.
10. Leave “Unflatten” alone.
11. Leave “Basic Auth” alone.
12. Set “Headers” to Content-Type | application/json
13. Test it out. If something isn’t working

See these screenshots for an example:Screenshot 2017-12-08 14.56.55.png

 

Screenshot 2017-12-08 15.12.05.png

 

Screenshot 2017-12-08 15.12.22.png

 

 

 


It took me a few hours one day to figure this out so hopefully it saves you all some time!.

 

Cheers!

brkn
Regular Contributor

Voting this up..

beckyschaen
Occasional Contributor

@jxlioTHANK YOU! This is a huge help.

 

Any chance you know how to add a return in a note? For example, I want the webhook to send it in multiple lines:

 

Description:
Note about products:
Company name:

jxlio
Occasional Contributor

@beckyschaen   You have perfect timing, I just figured that out a few days ago.

 

Just use html to manipulate the text:

 

{
    "engagement": {
        "active": true,
        "type": "NOTE"
    },
    "associations": {
        "contactIds": []
    },
    "metadata": {
        "body": "<h1>Header 1</h1><h2>Header 2</h2><h3>Header 3</h3><h4>Header 4</h4><h5>Header 5</h5><h6>Header 6</h6><strong>Bold</strong><br /><em>Italic</em><p>Paragraph Text Goes Here</p><p>Paragraph Two Text Goes Here</p>"
    }
}

Would look like this:

 

Screenshot 2018-07-24 18.38.23.png

 

 

 

 

agulentz
New Contributor

Hi All,

good catch @jxlio ! I've impelemented this in the same way some time ago. Now I'm facing encoding problems. While putting HTML, the code shouldn't contain any characters like "/" or "&". In my case it can happen given that the trigger from this ZAP takes values from a dynamic form (from process.st) and there any character can be put in. Do you have any idea how this can be solved if there is a character that would have to be endcoded for the JSON ?

jxlio
Occasional Contributor

@agulentz  I would use Zapier's Formater action to make sure that all characters like that are escaped (https://stackoverflow.com/questions/19176024/how-to-escape-special-characters-in-building-a-json-str...)

KrestenOE
New Contributor

 @jxlio (thanks for the guide, was perfect!) & @agulentz

 

I tried my way with Zapier's Formatter, but didn't end up with a viable solution. Upon reaching out to Zapier's support, they ultimately suggested using the 'Code by Zapier' app to sanetize the input with Javascript or Python, sounds reasonable to me - but a little out of my comfort zone. I'll share the code snippet here when I've gotten one of our devs to help me out.

twoolley
New Contributor

Hi,

 

If someone could help me here I would really appreciate it.  Properties Hubspot Owner ID doesn't seem to be available anymore.  What would I use instead?

Peta_APB
New Contributor

Hi

I'm currently using the custom request is Zapier Webhooks to log "calls" which is working well, but wondering if anyone can help me with how to also add Type and Outcome to the custom request?   

chrome_2019-05-29_10-49-09.png

 

Looking forward to your replies.

 

Kind regards

Peta