Sales Integrations

mestopiñalesb
Member

Get logged email activity date via API

SOLVE

From the UI when a new logged email is added to a contact (or editing one), the user can choose the sending date which can be different from the creation date of the logged email object. 

 

Using the Hubspot API, how can I retrieve a logged email's sending date or activity date?

 

According to the API documentation, I can only get the hs_timestamp field which is the creation date.

https://developers.hubspot.com/docs/api/crm/email

 

Thanks!

 

0 Upvotes
1 Accepted solution
Jim_from_Charik
Solution
Participant

Get logged email activity date via API

SOLVE

Hello @mestopiñalesb ,

 

here is the code you got when you use Hubspot API :

 

 

{
    "id": "32022843104",
    "properties": {
        "hs_createdate": "2024-08-29T17:11:29.843Z",
        "hs_email_headers": null,
        "hs_email_html": "<div style=\"\" dir=\"auto\" data-top-level=\"true\"><p style=\"margin:0;\">test email</p></div>",
        "hs_lastmodifieddate": "2024-08-29T17:11:29.843Z",
        "hs_object_id": "32022843104",
        "hs_timestamp": "2024-08-15T16:30:00Z"
    },
    "createdAt": "2024-08-29T17:11:29.843Z",
    "updatedAt": "2024-08-29T17:11:29.843Z",
    "archived": false
}

 

 

  • hs_timestamp : is the timedate you sent the email in my example 15th of august
  • createAt : is the timedate you create the logged email in my example 29th of august

Jim_from_Charik_0-1724952886450.png

 

To do so, use this call (ENGAGEMENT API) of course this is an example, you need to adapt it a bit by changing email_id and your APIKEY :

 

 

 

If you ask yourself, but how can I get the logged email id ?

Will it be my first "SOLVED" ???
 

View solution in original post

3 Replies 3
Jim_from_Charik
Solution
Participant

Get logged email activity date via API

SOLVE

Hello @mestopiñalesb ,

 

here is the code you got when you use Hubspot API :

 

 

{
    "id": "32022843104",
    "properties": {
        "hs_createdate": "2024-08-29T17:11:29.843Z",
        "hs_email_headers": null,
        "hs_email_html": "<div style=\"\" dir=\"auto\" data-top-level=\"true\"><p style=\"margin:0;\">test email</p></div>",
        "hs_lastmodifieddate": "2024-08-29T17:11:29.843Z",
        "hs_object_id": "32022843104",
        "hs_timestamp": "2024-08-15T16:30:00Z"
    },
    "createdAt": "2024-08-29T17:11:29.843Z",
    "updatedAt": "2024-08-29T17:11:29.843Z",
    "archived": false
}

 

 

  • hs_timestamp : is the timedate you sent the email in my example 15th of august
  • createAt : is the timedate you create the logged email in my example 29th of august

Jim_from_Charik_0-1724952886450.png

 

To do so, use this call (ENGAGEMENT API) of course this is an example, you need to adapt it a bit by changing email_id and your APIKEY :

 

 

 

If you ask yourself, but how can I get the logged email id ?

Will it be my first "SOLVED" ???
 
TomM2
Thought Leader | Platinum Partner
Thought Leader | Platinum Partner

Get logged email activity date via API

SOLVE

Hey @mestopiñalesb Logged email in HubSpot just works by BCCing the HubSpot address to log it to a contact. It doesn't really "integrate" with the mailbox on a much deeper level than that. So if your sending date is different to the date the email event was created in HubSpot, HubSpot isn't going to know this. 

I'm definitely missing something though, where within the HubSpot UI are you seeing the different "sending date" and "creation date"? 
I would see creation date as when the contact was created, and sending date being when the email event happened. So hs_timestamp should give the timestampe of when the email event was created, not the contact. I'm curious though where in the UI are you referring to seeing creation date and sending date? It might help me get you an answer! 

Tom Mahon
Technical Consultant | Solutions Engineer | Community Champion
Baskey Digitial

Book a consultation

Did my post help answer your query? Help the community (and me) by marking it as a solution.


0 Upvotes
mestopiñalesb
Member

Get logged email activity date via API

SOLVE

Hi Tom, thanks for the reply... I am trying to get the contact activity through the API (notes, emails, calls, etc) as a timeline...

 

In the Hubspot UI (contact/activities/emails) I can add a logged email by clicking the "Log Email" button. I can select the contacted person, Date and Time, etc... in my case, the email was sent outside Hubspot last week, I want to record it now and set the Date and Time of last week when it was sent. So far everything works fine, in activities I see the logged email with the correct date from last week.

 

Similar to this use case, you can see the activity date is different from a creation date

mestopialesb_0-1724697288967.png

 

But I can't get through the API the Date and Time I set before, only the created date (which is now). Any ideas?

 

Thanks!

0 Upvotes