Просто попробуйте добавить $ expand к вашему запросу.
items = client
.users(mailbox)
.drives(drive-id)
.items(att.id)
.buildRequest(Lists.newArrayList(new QueryOption("$expand","fields")))
.get();
Примечание:
Не все пользовательские метаданные могут быть получены с помощью графикаAPI.
Short:
/items?expand=fields
Мой фактический тестовый запрос:
https://graph.microsoft.com/v1.0/sites/{site id}/drives/{drive-id}/list/items?expand=fields
Ответ (MyTestMetadata1 - мои тестовые метаданные):
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site id')/drives('drive id')/list/items",
"value": [
{
"@odata.etag": "\"c800e34f-6ee4-4d46-8a56-2811078509e7,2\"",
"createdDateTime": "2018-10-25T04:20:05Z",
"eTag": "\"c800e34f-6ee4-4d46-8a56-2811078509e7,2\"",
"id": "4",
"lastModifiedDateTime": "2018-10-25T04:20:07Z",
"webUrl": "https://xxx.sharepoint.com/sites/Test/Shared%20Documents/CenterText.js",
"createdBy": {
"user": {
"email": "xxx@xxx.onmicrosoft.com",
"id": "f5d39dec-1642-48b2-90ee-1da477f61a1c",
"displayName": "xxx"
}
},
"lastModifiedBy": {
"user": {
"email": "xxx@xxx.onmicrosoft.com",
"id": "f5d39dec-1642-48b2-90ee-1da477f61a1c",
"displayName": "xxx"
}
},
"parentReference": {
"id": "3638238d-a591-4105-b6c7-a9251be75d93"
},
"contentType": {
"id": "0x0101007264AD3105D388488F4C729B0CC03CCF"
},
"fields@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('site-id')/drives('drive-id')/list/items('4')/fields/$entity",
"fields": {
"@odata.etag": "\"c800e34f-6ee4-4d46-8a56-2811078509e7,2\"",
"Modified": "2018-10-25T04:20:07Z",
"FileLeafRef": "CenterText.js",
"MyTestMetadata1": "OK",
"id": "4",
"ContentType": "Document",
"Created": "2018-10-25T04:20:05Z",
"AuthorLookupId": "6",
"EditorLookupId": "6",
"_CheckinComment": "",
"LinkFilenameNoMenu": "CenterText.js",
"LinkFilename": "CenterText.js",
"DocIcon": "js",
"FileSizeDisplay": "1209",
"ItemChildCount": "0",
"FolderChildCount": "0",
"_ComplianceFlags": "",
"_ComplianceTag": "",
"_ComplianceTagWrittenTime": "",
"_ComplianceTagUserId": "",
"_CommentCount": "",
"_LikeCount": "",
"Edit": "0",
"_UIVersionString": "1.0",
"ParentVersionStringLookupId": "4",
"ParentLeafNameLookupId": "4"
}
}
]
}