Как проверить, что настраиваемое свойство Outlook доступно через Microsoft Graph

Я добавил настраиваемое свойство к событию с помощью надстройки office.js.

Я попытался получить значение этого настраиваемого свойства с помощью https://graph.microsoft.com/v1.0/me/events/AQMkADU2OWFjYTF..AAAA==?singleValueExtendedProperties($filter=id eq 'String 00020329-0000-0000-C000-000000000046 myCusPropId '), но он вернул ошибку:

{
  "error": {
    "code": "ErrorInvalidProperty",
    "message": "PropertyId values may only be in one of the following formats: 'MapiPropertyType namespaceGuid Name propertyName', 'MapiPropertyType namespaceGuid Id propertyId' or 'MapiPropertyType propertyTag'.",
    "innerError": {
      "request-id": "c57cd272-2c10-4721-b48e-1c27117ea34f",
      "date": "2019-09-27T10:23:03"
    }
  }
}

Как мне получить myCusPropId?

вот код office.js

const item = Office.context.mailbox.item;
item.loadCustomPropertiesAsync(asyncResult => {
      if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {
        let customProps = asyncResult.value; 
        customProps.set("myCusProp", "google.com");
        customProps.saveAsync(asyncResult => {
          if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {            
             item.loadCustomPropertiesAsync(asyncResult => {
              const customProps = asyncResult.value;
              const myCusProp= customProps.get("myCusProp"); 
            })
          }});}});

person InfoÁsith    schedule 27.09.2019    source источник
comment
Это должно быть: ($filter=id eq 'String 00020329-0000-0000-C000-000000000046 Name myCusPropId') Обратите внимание на Name ключевое слово перед названием вашей собственности. Также избегайте лишних пробелов, как в myCusPropId '   -  person Ivan Franjic    schedule 27.09.2019
comment
@ Иван Франджич. я пошел по пути. я столкнулся с этим stackoverflow.com/questions/58166439/   -  person InfoÁsith    schedule 30.09.2019
comment
Попробуйте https://graph.microsoft.com/v1.0/me/events/AQMkADU2OWFjYTF..AAAA==?$expand=singleValueExtendedProperties($filter=PropertyId eq 'String {00020329-0000-0000-C000-000000000046} Name myCusPropId'). filter = PropertyId вместо id.   -  person Outlook Add-ins Team - MSFT    schedule 08.10.2019
comment
попробовал это https://graph.microsoft.com/v1.0/me/events/AQMkADU2OWFjYTF..AAAA==?$expand=singleValueExtendedProperties($filter=PropertyId eq 'String {00020329-0000-0000-C000-000000000046} Name myCusPropId' и дал неверный запрос { "error": { "code": "BadRequest", "message": "Parsing Select and Expand failed.", "innerError": { "request-id": "dd23f71e-9ab4-4137-9a3a-1d01b647f6fc", "date": "2019-10-08T06:21:21" } } }   -  person InfoÁsith    schedule 08.10.2019


Ответы (1)


Вам не хватает _ 1_ параметр запроса, и ваш идентификатор неверен. Правильный фототип звонка выглядит так:

GET /me/events/{id}?$expand=singleValueExtendedProperties($filter=id eq '{prop_id}')

Обратите внимание на ?$expand=singleValueExtendedProperties, а не на ?singleValueExtendedProperties.

Для самого свойства вам не хватает сегмента Name:

String {00020329-0000-0000-C000-000000000046} Name myCusPropId

Итак, окончательный URI будет:

https://graph.microsoft.com/v1.0/me/events/AQMkADU2OWFjYTF..AAAA==?$expand=singleValueExtendedProperties($filter=id eq 'String {00020329-0000-0000-C000-000000000046} Name myCusPropId')

person Marc LaFleur    schedule 27.09.2019
comment
Я просто попробовал этот способ, но в ответе нет сведений о настраиваемых свойствах. я создал новый вопрос для этого свойства stackoverflow.com/questions/58166439/ - person InfoÁsith; 30.09.2019
comment
Это правильный идентификатор 00020329-0000-0000-C000-000000000046? - person InfoÁsith; 30.09.2019
comment
да. Добавьте код, который вы используете для добавления данных через Office.js. - person Marc LaFleur; 30.09.2019