有什么方法可以通过 webhook 或 API 从我的帐户中导出所有计划的、过去的和即将发生的事件?
具体来说,我还希望能够获得对这些预订/活动问题的回复。
我可以使用 API 获得事件列表,但是这不会将对事件问题的响应传回。有没有办法以编程方式做到这一点?如果我能够通过我的账户界面调用触发 EXPORT 功能,那就太好了,并且满足我需要的数据的要求。
谢谢
问题的答案特定于每个被邀请者,而不是整个事件(一个事件可以有多个被邀请者),因此您需要获取给定事件的被邀请者列表(在 API v2 中)。每个受邀者项目都有一个questions_and_answers
数组。
示例请求和响应:
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": "test@example.com",
"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"
}
}
注意:如果您有来自先前 API 响应的事件 URI(例如https://api.calendly.com/scheduled_events/846428db-f54e-4196-8075-4204673aac7a)
,只需附加/invitees
到它以获取所有被邀请者的列表。您不必从头开始构建整个 URL。