javascript - Microsoft Graph Api - 约会预订日期时间问题
问题描述
所以我一直在使用 microsoft bookings Beta Api 从这个 URL 获取列表:
GET https://graph.microsoft.com/beta/bookingBusinesses/Contosolunchdelivery@M365B489948.onmicrosoft.com/appointments
它工作正常,除了我需要获取特定约会的开始 -> 日期时间和结束 -> 日期时间,但它返回错误的开始日期?即使当我去预订时,我也清楚地输入了开始时间。
这就是 JSON-Example 的样子:
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#bookingBusinesses('Contosolunchdelivery%40M365B489948.onmicrosoft.com')/appointments",
"value": [
{
"id": "AAMkADKoAAA=",
"selfServiceAppointmentId": "00000000-0000-0000-0000-000000000000",
"customerId": "829e3cb5-3d4d-4319-a8de-1953aedaa166",
"customerName": "Bob Kelly",
"customerEmailAddress": "bobk@tailspintoys.com",
"customerPhone": "213-555-0108",
"customerNotes": null,
"serviceId": "57da6774-a087-4d69-b0e6-6fb82c339976",
"serviceName": "Catered bento",
"duration": "PT30M",
"preBuffer": "PT5M",
"postBuffer": "PT10M",
"priceType": "fixedPrice",
"price": 10,
"serviceNotes": null,
"optOutOfCustomerEmail": false,
"staffMemberIds": [],
"invoiceAmount": 10,
"invoiceId": "1002",
"invoiceStatus": "open",
"invoiceUrl": "theInvoiceUrl",
"customerLocation": {
"displayName": "Customer",
"locationEmailAddress": null,
"locationUri": "",
"locationType": null,
"uniqueId": null,
"uniqueIdType": null,
"address": {
"type": "home",
"postOfficeBox": "",
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {
"altitude": null,
"latitude": null,
"longitude": null,
"accuracy": null,
"altitudeAccuracy": null
}
},
"start": {
"dateTime": "2018-04-30T13:00:00.0000000Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-04-30T13:30:00.0000000Z",
"timeZone": "UTC"
},
"serviceLocation": {
"displayName": "Customer location (987 Third Avenue, Buffalo, NY 98052, USA)",
"locationEmailAddress": null,
"locationUri": "",
"locationType": null,
"uniqueId": null,
"uniqueIdType": null,
"address": {
"type": "home",
"postOfficeBox": "",
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {
"altitude": null,
"latitude": null,
"longitude": null,
"accuracy": null,
"altitudeAccuracy": null
}
},
"reminders": [],
"invoiceDate": {
"dateTime": "2018-04-30T13:30:00.0000000Z",
"timeZone": "UTC"
}
},
{
"id": "AAMkADKnAAA=",
"selfServiceAppointmentId": "00000000-0000-0000-0000-000000000000",
"customerId": "7ed53fa5-9ef2-4f2f-975b-27447440bc09",
"customerName": "Jordan Miller",
"customerEmailAddress": "jordanm@contoso.com",
"customerPhone": "213-555-0199",
"customerNotes": null,
"serviceId": "57da6774-a087-4d69-b0e6-6fb82c339976",
"serviceName": "Catered bento",
"duration": "PT30M",
"preBuffer": "PT5M",
"postBuffer": "PT10M",
"priceType": "fixedPrice",
"price": 10,
"serviceNotes": null,
"optOutOfCustomerEmail": false,
"staffMemberIds": [],
"invoiceAmount": 10,
"invoiceId": "1001",
"invoiceStatus": "open",
"invoiceUrl": "theInvoiceUrl",
"customerLocation": {
"displayName": "Customer",
"locationEmailAddress": null,
"locationUri": "",
"locationType": null,
"uniqueId": null,
"uniqueIdType": null,
"address": {
"type": "home",
"postOfficeBox": "",
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {
"altitude": null,
"latitude": null,
"longitude": null,
"accuracy": null,
"altitudeAccuracy": null
}
},
"start": {
"dateTime": "2018-05-01T12:00:00.0000000Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-05-01T12:30:00.0000000Z",
"timeZone": "UTC"
},
"serviceLocation": {
"displayName": "Customer location (123 First Avenue, Buffalo, NY 98052, USA)",
"locationEmailAddress": null,
"locationUri": "",
"locationType": null,
"uniqueId": null,
"uniqueIdType": null,
"address": {
"type": "home",
"postOfficeBox": "",
"street": "",
"city": "",
"state": "",
"countryOrRegion": "",
"postalCode": ""
},
"coordinates": {
"altitude": null,
"latitude": null,
"longitude": null,
"accuracy": null,
"altitudeAccuracy": null
}
},
"reminders": [],
"invoiceDate": {
"dateTime": "2018-05-01T12:30:00.0000000Z",
"timeZone": "UTC"
}
}
]
}
这就是我得到的开始和结束日期时间:
start:
dateTime: "0001-01-01T00:00:00.0000000Z"
timeZone: "Etc/UTC"
end:
dateTime: "0001-01-01T00:00:00.0000000Z"
timeZone: "Etc/UTC"
我不知道我做错了什么,我会很感激任何帮助。
解决方案
因此出于某种原因使用此 URL:
GET /bookingBusinesses/{id}/calendarView?start={start-value}&end={end-value}
确实最终给了我我正在寻找的正确时间的确切结果以及列表约会网址给我的所有内容。
我想这就是为什么它仍然处于测试阶段
推荐阅读
- php - 如何修复'单选按钮值未保存在数据库中
- c# - 无法同时发布元数据和多部分。收到 400 错误请求
- design-patterns - 两个类之间的“创建”/实例化关系是什么?
- c# - 如何对 w3wp 进行故障排除
- python - 当球第一次和第二次击中它时如何使矩形改变颜色,然后在第三次击中时使其消失?
- c# - 通过 url 进行 ASP.NET Core 2 本地化。页面上生成的 url 语言路由值不一致
- sql - 连接表中没有匹配的行将整行归零
- c# - 每个 API 创建一个 HTTP 客户端
- python - 需要使用其列将新的 DateTime 列添加到已经存在的数据框
- machine-learning - 什么是机器学习的动力?