APIs & Integrations

APIANT
Participant | Elite Partner
Participant | Elite Partner

startTime & endTime when creating "MEETING" engagements aren't accurate

SOLVE

Based on this api doc, when creating a "MEETING" engagement, the startTime & endTime format should be:

// Integer; A Unix timestamp in milliseconds

 When I give it 1568145600000 which should equate to Tue Sep 10 2019 20:00:00 UTC or Tue Sep 10 2019 16:00:00 Eastern daylight, I get 09/07/2019 7:57 PM instead.

Image 2019-09-07 at 7.58.16 PM.png

Is it not expecting Unix timestamp in milliseconds?

 

Thanks,

0 Upvotes
2 Accepted solutions
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

startTime & endTime when creating "MEETING" engagements aren't accurate

SOLVE

Hi @APIANT,

 

I hope all is well with you 😄

 

You're right to say that the UNIX timestamp 1568145600000 should equate to Tue Sep 10 2019 20:00:00 UTC or Tue Sep 10 2019 16:00:00 Eastern daylight.

 

On my end, when using the Create an Engagement | Engagements API endpoint to create a MEETING engagement with the startDate as 1568145600000, I'm able to see that it is showing as GMT: Tuesday, 10 September 2019, 8:00:00 PM GMT just fine. 

 

This is the post body that I posted across on this endpoint - /engagements/v1/engagements:

 

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "MEETING",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact_id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
"metadata": {
    "body": "This is the description3.",
    "startTime": 1568145600000,
    "endTime": 1568271989000,
    "title": "Event title4"
  }
}

And how it is reflecting on my contact record:

Screen Shot 2019-09-09 at 3.20.52 PM.png

Note: My HubSpot portal timezone is GMT +8; to prevent confusion, Wednesday, 11 September 2019, 4:00:00 AM GMT+08:00 is equal to Tuesday, 10 September 2019, 8:00:00 PM GMT so it seems that the startTime got created just fine.

 

In this case, do you mind sharing with me your request post body and the HubSpot portal that you're creating the MEETING engagement on?

View solution in original post

0 Upvotes
APIANT
Solution
Participant | Elite Partner
Participant | Elite Partner

startTime & endTime when creating "MEETING" engagements aren't accurate

SOLVE

Hi @WendyGoh 

 

Thank you for this.

 

Apparently we were sending the wrong date format.

 

This is working as expected now.

 

Thank you!

View solution in original post

0 Upvotes
2 Replies 2
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

startTime & endTime when creating "MEETING" engagements aren't accurate

SOLVE

Hi @APIANT,

 

I hope all is well with you 😄

 

You're right to say that the UNIX timestamp 1568145600000 should equate to Tue Sep 10 2019 20:00:00 UTC or Tue Sep 10 2019 16:00:00 Eastern daylight.

 

On my end, when using the Create an Engagement | Engagements API endpoint to create a MEETING engagement with the startDate as 1568145600000, I'm able to see that it is showing as GMT: Tuesday, 10 September 2019, 8:00:00 PM GMT just fine. 

 

This is the post body that I posted across on this endpoint - /engagements/v1/engagements:

 

{
    "engagement": {
        "active": true,
        "ownerId": 1,
        "type": "MEETING",
        "timestamp": 1409172644778
    },
    "associations": {
        "contactIds": [{{contact_id}}],
        "companyIds": [ ],
        "dealIds": [ ],
        "ownerIds": [ ]
    },
"metadata": {
    "body": "This is the description3.",
    "startTime": 1568145600000,
    "endTime": 1568271989000,
    "title": "Event title4"
  }
}

And how it is reflecting on my contact record:

Screen Shot 2019-09-09 at 3.20.52 PM.png

Note: My HubSpot portal timezone is GMT +8; to prevent confusion, Wednesday, 11 September 2019, 4:00:00 AM GMT+08:00 is equal to Tuesday, 10 September 2019, 8:00:00 PM GMT so it seems that the startTime got created just fine.

 

In this case, do you mind sharing with me your request post body and the HubSpot portal that you're creating the MEETING engagement on?

0 Upvotes
APIANT
Solution
Participant | Elite Partner
Participant | Elite Partner

startTime & endTime when creating "MEETING" engagements aren't accurate

SOLVE

Hi @WendyGoh 

 

Thank you for this.

 

Apparently we were sending the wrong date format.

 

This is working as expected now.

 

Thank you!

0 Upvotes