APIs & Integrations

FoodIsFriend
Member

How to retrieve meetings based on customer's email

SOLVE

Hi,

I would love some help on this simple api call that has got me stuck. Thank You in advanced!!

Basically I am working on an app that should retrieve all of the meetings the user/customer has made filtering on their email.

Of all the properties in the meeting here I don't see anything that is associated with the user's email. I just need help with the appropriate api post body on crm/v3/objects/meetings/search 

0 Upvotes
1 Accepted solution
zach_threadint
Solution
Guide

How to retrieve meetings based on customer's email

SOLVE

Hi @FoodIsFriend 👋

Thanks for clarifying. Given there doesn't seem to be a Meetings property that stores attendee email addresses, you could consider achieving this following these steps:

 

CRM Search Contacts where "Latest meeting activity" (hs_latest_meeting_activity) is known (i.e. Contacts that are associated with at least 1 Meeting -- keep in mind CRM Search API allows a maximum of 10,000 results, with a max page size of 200)

curl --location 'https://api.hubapi.com/crm/v3/objects/CONTACT/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-redacted' \
--data '{
    "limit": "200",
    "properties": [
        "email",
        "hs_latest_meeting_activity"
    ],
    "filterGroups": [
        {
            "filters": [
                {
                    "propertyName": "hs_latest_meeting_activity",
                    "operator": "HAS_PROPERTY"
                }
            ]
        }
    ]
}'

2. Get each Contact individually (those returned from step 1) with their associated Meetings

curl --location 'https://api.hubapi.com/crm/v3/objects/CONTACT/:CONTACT_ID?associations=MEETING' \
--header 'Authorization: Bearer pat-redacted'

3. If required, retrieve batches of Meetings (those returned from step 2, with target Meeting properties)

curl --location 'https://api.hubapi.com/crm/v3/objects/MEETINGS/batch/read' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-redacted'
--data '{
"properties": [
"hs_meeting_start_time",
"hs_meeting_end_time"
],
"inputs": [
{
"id": "12345"
},
{
"id": "67890"
},
{
"id": "1234567890"
}
]
}'

It seems a little convoluted for such a simple use case. However, given there doesn't seem to be a Meeting property that stores attendee email addresses, I don't see a simpler way to solve it.

 

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


View solution in original post

0 Upvotes
4 Replies 4
zach_threadint
Solution
Guide

How to retrieve meetings based on customer's email

SOLVE

Hi @FoodIsFriend 👋

Thanks for clarifying. Given there doesn't seem to be a Meetings property that stores attendee email addresses, you could consider achieving this following these steps:

 

CRM Search Contacts where "Latest meeting activity" (hs_latest_meeting_activity) is known (i.e. Contacts that are associated with at least 1 Meeting -- keep in mind CRM Search API allows a maximum of 10,000 results, with a max page size of 200)

curl --location 'https://api.hubapi.com/crm/v3/objects/CONTACT/search' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-redacted' \
--data '{
    "limit": "200",
    "properties": [
        "email",
        "hs_latest_meeting_activity"
    ],
    "filterGroups": [
        {
            "filters": [
                {
                    "propertyName": "hs_latest_meeting_activity",
                    "operator": "HAS_PROPERTY"
                }
            ]
        }
    ]
}'

2. Get each Contact individually (those returned from step 1) with their associated Meetings

curl --location 'https://api.hubapi.com/crm/v3/objects/CONTACT/:CONTACT_ID?associations=MEETING' \
--header 'Authorization: Bearer pat-redacted'

3. If required, retrieve batches of Meetings (those returned from step 2, with target Meeting properties)

curl --location 'https://api.hubapi.com/crm/v3/objects/MEETINGS/batch/read' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer pat-redacted'
--data '{
"properties": [
"hs_meeting_start_time",
"hs_meeting_end_time"
],
"inputs": [
{
"id": "12345"
},
{
"id": "67890"
},
{
"id": "1234567890"
}
]
}'

It seems a little convoluted for such a simple use case. However, given there doesn't seem to be a Meeting property that stores attendee email addresses, I don't see a simpler way to solve it.

 

I hope that proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
zach_threadint
Guide

How to retrieve meetings based on customer's email

SOLVE

Hi @FoodIsFriend 👋

 

You'll need to perform a lookup on the relevant HubSpot Owner to find their email address. You can retrieve all Owners via the following API call:

curl --location 'https://api.hubapi.com/crm/v3/owners' \
--header 'Authorization: Bearer pat-redacted'

You'd then match the given Meeting's "hubspot_owner_id" with the relevant "id" in the API response results, before extracting their "email".

 

I hope this proves helpful. Please let me know if you have any follow-up questions.

All the best,

Zach

--

Zach Klein
HubSpot Integrations & App Developer
Meanjin / Brisbane, Australia



Say g'day


If my post helped answer your query, please consider marking it as a solution.


0 Upvotes
FoodIsFriend
Member

How to retrieve meetings based on customer's email

SOLVE

Hi @zach_threadint Thank you so much for the response. I have a followup question.

As I understand the hubspot_owner_id is the internal staff user who is the one getting booked, is it not? I want to filter by the customer aka external user's email - the email they used when booking the meeting.

 

edit: also the relationship between customer and internal user meeting is one to many

0 Upvotes
FoodIsFriend
Member

How to retrieve meetings based on customer's email

SOLVE

@zach_threadint Basically I am looking for the email of the other party not the owner's email. Thanks

0 Upvotes