Reputation: 11
Is there any way to get an EXPORT of all Scheduled, Past and Upcoming Events from my Account BUT via a webhook or API?
Specifically, I want to be able to also get the Responses to questions on these bookings/events.
I can get the List of events okay using an API HOWEVER this does not pass back the responses to the questions on the event. Is there any way to do this programmatically? If I was able to make a call to trigger the EXPORT function as available through the interface of my account, that would be great and meet the requirements of the data I need.
Thank you
Upvotes: 1
Views: 832
Reputation: 13516
The answers to questions are specific to each Invitee, not the whole Event (an Event can have multiple Invitees), so you need to get List of Invitees (in API v2) for a given Event. Each Invitee item will have a questions_and_answers
array.
Example request and response:
curl --request GET \
--url https://api.calendly.com/scheduled_events/<UUID>/invitees \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'
{
"collection": [
{
"cancel_url": "https://calendly.com/cancellations/AAAAAAAAAAAAAAAA",
"created_at": "2020-11-23T17:51:18.327602Z",
"email": "[email protected]",
"event": "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA",
"name": "John Doe",
"new_invitee": null,
"old_invitee": null,
"questions_and_answers": [
{
"answer": "radio button answer",
"position": 0,
"question": "Question with Radio Buttons answer type"
},
{
"answer": "Multiple line\nAnswer",
"position": 1,
"question": "Question with Multiple Lines answer type"
},
{
"answer": "Answer 1\nAnswer 2\nAnswer 3",
"position": 2,
"question": "Question with Checkboxes answer type"
}
],
"reschedule_url": "https://calendly.com/reschedulings/AAAAAAAAAAAAAAAA",
"rescheduled": false,
"status": "active",
"text_reminder_number": null,
"timezone": "America/New_York",
"tracking": {
"utm_campaign": null,
"utm_source": null,
"utm_medium": null,
"utm_content": null,
"utm_term": null,
"salesforce_uuid": null
},
"updated_at": "2020-11-23T17:51:18.341657Z",
"uri": "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
"canceled": false,
"payment": {
"external_id": "ch_AAAAAAAAAAAAAAAAAAAAAAAA",
"provider": "stripe",
"amount": 1234.56,
"currency": "USD",
"terms": "sample terms of payment (up to 1,024 characters)",
"successful": true
}
}
],
"pagination": {
"count": 1,
"next_page": "https://calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees?count=1&page_token=sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi"
}
}
Note: if you have an Event URI from a previous API response (e.g. https://api.calendly.com/scheduled_events/846428db-f54e-4196-8075-4204673aac7a)
, just append /invitees
to it to get a list of all Invitees. You don't have to build the whole URL from scratch.
Upvotes: 1