Solved

How to use API to fetch invitee.create events for a given time period

  • 15 May 2024
  • 2 replies
  • 116 views

I’m planning on registering a webhook to receive “invitee.created” events in real-time for my organization.  I’m also planning to code a backup job, which can use the Calendly API to fetch invitee.created events.  That way, if for whatever reason, the webhook callbacks are lost or quit being received, the backup job can fetch the invitee information until the webhook subscription issues are resolved.

How would you recommend getting the invitee created data using the API?  It appears the `activity_log_entries` endpoint does not return events, unless the event is triggered by a user, who belongs to the organization.  In my case, the people, who book a meeting/event, are not members of the organization.

So, it looks like the only way to get the invitee created data is to fetch all active scheduled events using `scheduled_events` endpoint with status = active.  Then, make an individual call for each scheduled event to fetch invitees data.  If we have 100 active scheduled events, we’d need to make 100 calls to fetch invitees.  

Is there a better way to fetch the invitee.created events? 

icon

Best answer by Austin 21 May 2024, 18:26

View original

This topic has been closed for comments

2 replies

Userlevel 2

Hey @Kurt31618 Great question! In the event that your webhook subscription failed to provide you with the data associated with your invitee.create hook, then you could look to use the list events endpoint (reference here). 

This allows for defining a few useful parameters: 

count:

group:

invitee_email:

max_start_time:

min_start_time:

organization:

page_token:

sort:

status:

user: 

 

Specifically you could define the min start time (start of timeframe) with the max start time (end of timeframe) in additional to defining the organization, or scoped to a specific user. I’d say this could be a good fallback for reporting events created in a given timeframe!

Hi Austin, thanks very much for the reply.  Your answer confirms what I was thinking. 

It would be a 2 step process

Step 1 call `https://api.calendly.com/scheduled_events` with organization query parameter and start/end time.

Step 2: For each scheduled event returned, call  `https://api.calendly.com/scheduled_events/{eventUUID}/invitees`.  This gives back the similar data that we get from the webhook callbacks.

Since Step 1 would include the start/end time parameters, hopefully that will reduce the number of calls we need to make in Step 2.

Thanks again!