Get / me / events / {id} возвращает неверный объект календаря - PullRequest
1 голос
/ 14 января 2020

Я попытался получить список событий из конечной точки /me/events?$expand=calendar, и он в ответ возвращает правильный объект календаря.

Однако, когда я попытался извлечь одно конкретное событие, я получил другой календарь. Используемый API: /me/events/{id}?$expand=calendar У пользователя есть 4 календаря (проверено с помощью / me / calendars). И идентификатор календаря, полученный от /me/events/{id}?$expand=calendar, не совпадает ни с одним из них.

Редактировать

Ниже приведены ответы для уточнения

  1. Конечная точка для вывода списка всех календарей

    https://graph.microsoft.com/v1.0/me/calendars
    

    Ответ:

    {
        "value": [
            {
                "id": "<CALENDAR_ID_1>",
                "name": "Calendar",
                "color": "auto",
                "changeKey": "<changeKey>",
                "canShare": true,
                "canViewPrivateItems": true,
                "canEdit": true,
                "owner": {
                    "name": "<Name>",
                    "address": "<Email>"
                }
            },
            {
                "id": "<CALENDAR_ID_2>",
                "name": "Birthdays",
                "color": "auto",
                "changeKey": "<changeKey>",
                "canShare": false,
                "canViewPrivateItems": true,
                "canEdit": false,
                "owner": {
                    "name": "TestVoIP 1",
                    "address": "<Email>"
                }
            },
            ....
        ]
    }
    
  2. Список всех событий

    https://graph.microsoft.com/v1.0/me/events?$expand=calendar
    

    Ответ :

    {
        "value": [
            {
                "id": "<EVENT_ID_1>",
                ... some other properties
                "calendar": {
                    "id": "<CALENDAR_ID_1>", // Note that this is the calendar id for EVENT_ID_1
                    "name": "Calendar",
                    "color": "auto",
                    "changeKey": "<changeKey>",
                    "canShare": true,
                    "canViewPrivateItems": true,
                    "canEdit": true,
                    "owner": {
                        "name": "<Name>",
                        "address": "<Email>"
                    }
                },
            },
            {
                "id": "<EVENT_ID_2>",
                ... some other properties
                "calendar": {
                    "id": "<CALENDAR_ID_1>",
                    "name": "Calendar",
                    "color": "auto",
                    "changeKey": "<changeKey>",
                    "canShare": true,
                    "canViewPrivateItems": true,
                    "canEdit": true,
                    "owner": {
                        "name": "<Name>",
                        "address": "<Email>"
                    }
                },
            },
            ...
        ]
    }
    
  3. Получить событие с идентификатором

    https://graph.microsoft.com/v1.0/me/events/<EVENT_ID_1>?$expand=calendar
    

    Ответ:

    {
        "id": "<EVENT_ID_1>",
        ... some other properties
        "calendar": {
            "id": "<DIFFERENT_CALENDAR_ID>", // Note that this is entirely different calendar id than we noted in list of events response AND its not available in list of calendars response too
            "name": null,
            "color": "auto",
            "changeKey": null,
            "canShare": false,
            "canViewPrivateItems": false,
            "canEdit": false,
            "owner": null
        }
    }
    
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...