crm.objects.meetings.basicApi.create

Hello,

I’m using crm.objects.meetings.basicApi.create in a custom code in a workflow to create meetings, it’s work but the meetings doesn’t appear in me google calendar.

i send those properties:

const properties = {
“hs_timestamp”: from,
“hubspot_owner_id”: “385059318”,
“hs_meeting_title”: "1Ménage départ: "+dealname,
“hs_meeting_body”: “Ménage départ, durée du séjour: “+nbNuits +” nuits”,
“hs_internal_meeting_notes”: “”,
“hs_meeting_location_type”: “ADDRESS”,
“hs_meeting_location”: logement.properties.adresse,
“hs_meeting_start_time”: from,
“hs_meeting_end_time”: to,
“hs_meeting_outcome”: “SCHEDULED”,
“hs_activity_type”:“Ménage”
};

in the result i haven’t the “hs_created_by”: null, may be it’s the problem

When i create one manually it’s ok i don’t understand the problem.

thanks for your answer

Hello @cpradalier
You are correct, the hs_created_by property is required for HubSpot to sync meetings to Google Calendar. You can either specify the hs_created_by property in your custom code, or you can configure HubSpot to automatically populate this property. Once you have configured HubSpot to automatically populate the hs_created_by property, meetings created in HubSpot will be synced to Google Calendar.
you can use this code to create meetings

const properties = {
 "hs_timestamp": from,
 "hubspot_owner_id": "385059318",
 "hs_meeting_title": "1Ménage départ: "+dealname,
 "hs_meeting_body": "Ménage départ, durée du séjour: "+nbNuits +" nuits",
 "hs_internal_meeting_notes": "",
 "hs_meeting_location_type": "ADDRESS",
 "hs_meeting_location": logement.properties.adresse,
 "hs_meeting_start_time": from,
 "hs_meeting_end_time": to,
 "hs_meeting_outcome": "SCHEDULED",
 "hs_activity_type":"Ménage"
};

const meeting = await hubspot.crm.objects.meetings.basicApi.create(properties);

console.log(meeting);

thanks for your answer, how can i configure HubSpot to automatically populate this property? Because i can’t specify the hs_created_by it’s a read only property.

Follow these steps

  1. Go to Settings > Integrations > Google Calendar.
  2. Click Edit next to the Meetings integration.
  3. Check the box next to Automatically populate the hs_created_by property with the user who created the meeting.
  4. Click Save.

thanks