Missing results when filtering messages by SentDateTime using Outlook REST API v2.0 - office365api

I'm trying to get all messages since 2017-06-15T18:24:13Z.
(I'm using 5-result pages and only selecting SentDateTime to simplify this case. This issue also happens when selecting more fields and a larger page size)
Requesting the total number of messages:
>>> https://outlook.office.com/api/v2.0/me/messages/$count?$filter=SentDateTime+ge+2017-06-15T18:24:13Z&select=SentDateTime&$top=5
3988
Now fetching the messages:
>>> https://outlook.office.com/api/v2.0/me/messages/?$filter=SentDateTime+ge+2017-06-15T18:24:13Z&select=SentDateTime&$top=5
{
"#odata.context": "https://outlook.office.com/api/v2.0/$metadata#Me/Messages(SentDateTime)",
"value": [
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAAAHSJlCAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABMlWeb\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAAAHSJlCAAA=",
"SentDateTime": "2017-06-15T18:27:24Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVnAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSF+rD\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVnAAA=",
"SentDateTime": "2017-06-15T18:37:29Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAAAHSJiQAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAe8\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAAAHSJiQAAA=",
"SentDateTime": "2017-06-15T19:12:22Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVpAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSF+rE\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVpAAA=",
"SentDateTime": "2017-06-15T19:15:58Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl74AAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAe9\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl74AAA=",
"SentDateTime": "2017-06-15T19:20:05Z"
}
],
"#odata.nextLink": "https://outlook.office.com/api/v2.0/me/messages/?%24filter=sentdatetime+ge+2017-06-15T18%3a24%3a13Z&%24select=SentDateTime&%24top=5&%24skip=5"
}
Requesting the next page:
>>> https://outlook.office.com/api/v2.0/me/messages/?$filter=sentdatetime+ge+2017-06-15T18:24:13Z&$select=SentDateTime&$top=5&$skip=5
{
"#odata.context": "https://outlook.office.com/api/v2.0/$metadata#Me/Messages(SentDateTime)",
"value": [
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl73AAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAe+\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl73AAA=",
"SentDateTime": "2017-06-15T19:24:13Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl70AAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAe/\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl70AAA=",
"SentDateTime": "2017-06-15T20:19:27Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVtAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSF+rF\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCpAADjWpP0ATh5SI1bqWxqzWOKAABMdlVtAAA=",
"SentDateTime": "2017-06-15T20:20:12Z"
}
]
}
The second response doesn't contain a nextLink, meanning there are only 8 results and the last message was sent at 2017-06-15T20:20:12Z.
However, when querying for the following day:
>>> https://outlook.office.com/api/v2.0/me/messages/?$filter=SentDateTime+ge+2017-06-16T00:00:00Z&select=SentDateTime&$top=5
{
"#odata.context": "https://outlook.office.com/api/v2.0/$metadata#Me/Messages(SentDateTime)",
"value": [
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8dAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAfR\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8dAAA=",
"SentDateTime": "2017-06-16T00:52:10Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8cAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAfS\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8cAAA=",
"SentDateTime": "2017-06-16T01:37:09Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8ZAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAfT\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8ZAAA=",
"SentDateTime": "2017-06-16T02:59:38Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8VAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAfU\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8VAAA=",
"SentDateTime": "2017-06-16T03:03:25Z"
},
{
"#odata.id": "https://outlook.office.com/api/v2.0/Users('d2fe4aac-1eae-4d14-9893-4f96f42ae46b#487bfe01-8734-4c88-9424-11fa0c5d445e')/Messages('AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8UAAA=')",
"#odata.etag": "W/\"CQAAABYAAADjWpP0ATh5SI1bqWxqzWOKAABSGAfV\"",
"Id": "AAMkADU3ZDE1ZGJiLTg4ZmUtNGVlYy1hYzE4LWMyNjE1NzY4YWUzYQBGAAAAAABGFgzFsCOpRISdXXbGh88oBwA0lgq1qqsaRYyJVwoDR59-AAAvWYCsAADjWpP0ATh5SI1bqWxqzWOKAABMdl8UAAA=",
"SentDateTime": "2017-06-16T03:20:12Z"
}
],
"#odata.nextLink": "https://outlook.office.com/api/v2.0/me/messages/?%24filter=SentDateTime+ge+2017-06-16T00%3a00%3a00Z&%24select=SentDateTime&%24top=5&%24skip=5"
}
Meaning there are indeed more messages than the 8 returned by the original request.
I tried modifying the request by starting from a different SentDateTime value, but it keeps stopping at this last message. The same issue happens with different mailboxes on different dates.
Any clue on how to approach this?
EDIT
As a temporary fix, I'm looping through all the folders (using /me/mailFolders) and fetching them one at time using the same filter. This seems to work in lieu of a proper solution

Can you try to query data from sentItems folder?
https://outlook.office.com/api/v2.0/me/mailFolders/SentItems/messages/?$filter=SentDateTime+ge+2017-06-15T18:24:13Z&select=SentDateTime&$top=5

Related

Microsoft Graph API: recent items - How to get onenote displayName instead of filename

My goal is to display the 6 most recent items in the current users OneDrive.
Using https://graph.microsoft.com/v1.0/me/drive/recent?top=6 gives me the correct documents.
Some of these documents are OneNote Items.
At www.office.com the OneNote Items are displayed with the Notebook's displayname.
In the API response only the filename is contained.
Testing this is Microsoft's example data here:
https://developer.microsoft.com/en-us/graph/graph-explorer
Example response
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/me/drive/recent?top=6&expand=section&$skiptoken=s!Njs3NGI0MzJjYS1mNmIzLTQ5YmQtOWIxMC02OTIyNjRlMTI3YTI",
"value": [
...
{
"#odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"size": 55782,
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"remoteItem": {
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"size": 55782,
"webDavUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/Documents/Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"parentReference": {
"driveType": "business",
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZ56Y2GOVW7725BZO354PWSELRRZ"
},
"shared": {
"scope": "users"
},
"sharepointIds": {
"listId": "23f045a1-e6df-457c-8d95-a6ebd5feda5d",
"listItemId": "36",
"listItemUniqueId": "0bc35248-e4e2-4759-ad85-89407bceccfe",
"siteId": "d82312f9-b23b-4cbc-95d5-3e0d94e68c1e",
"siteUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com",
"webId": "2f91174f-f0c8-45c7-9540-aad4195c8e09"
}
}
},
...
]
}
Is there a way to retrieve the OneNote notebook's name from here?
The API provides a way to retrieve all notebooks like so:
https://graph.microsoft.com/v1.0/me/onenote/notebooks
However I do not see a connection between these responses.
Maybe relevant how to find OneNote Notebook object from driveItem with MS Graph? - this shows a workaround. I am curious if there is a better solution.

The graph api is throwing BadRequest while writing mp4 file

I am trying to write a video file chunk by chunk at onedrive but, the graph api throws me a BadRequest.
Can anyone help me out...
I am using this code to write the files, other than video file I am able to create and write the file at onedrive.
graphClient.Users[UserEmailID].Drive.Items[Item.ParentItemID].Children.Request().AddAsync(SourceDriveItem).Result;
Following is the Json of SourceDriveItem
{
"file": {
"hashes": {
"quickXorHash": "bxXAIfX9S1d5xN8dqthmIc0m5L8=",
"#odata.type": "microsoft.graph.hashes"
},
"mimeType": "video/mp4",
"#odata.type": "microsoft.graph.file"
},
"fileSystemInfo": {
"createdDateTime": "2021-08-20T07:38:52+00:00",
"lastModifiedDateTime": "2021-08-20T07:38:52+00:00",
"#odata.type": "microsoft.graph.fileSystemInfo"
},
"photo": {
"takenDateTime": "2015-08-07T09:13:02+00:00",
"#odata.type": "microsoft.graph.photo"
},
"size": 1570024,
"video": {
"audioBitsPerSample": 110288,
"audioChannels": 2,
"audioFormat": "{00001610-0000-0010-8000-00AA00389B71}",
"audioSamplesPerSecond": 48000,
"bitrate": 291808,
"duration": 30526,
"fourCC": "H264",
"frameRate": 30000.0,
"height": 270,
"width": 480,
"#odata.type": "microsoft.graph.video"
},
"createdDateTime": "2021-08-20T07:38:52+00:00",
"lastModifiedBy": {
"user": {
"displayName": "SysTools Dev2",
"id": "38a682a6-5390-4e43-8610-442f35cb0026",
"#odata.type": "microsoft.graph.identity",
"email": "admin#dev2systoolsgroup.onmicrosoft.com"
},
"#odata.type": "microsoft.graph.identitySet"
},
"lastModifiedDateTime": "2021-08-20T07:38:52+00:00",
"name": "file_example_MP4_480_1_5MG.mp4",
"#odata.type": "microsoft.graph.driveItem"
}
I just set null to the Video property in the request body and it get solved. So avoid setting the Video object in DriveItem while adding the file

Time Series Insights not showing sub-object properties of a key/value pair

I have an application that is pushing data into IoT Hub which is being used as a data source for TSI. Below is an example message:
{
"EnqueuedTimeUtc": "2021-06-17T22:00:47.2170000Z",
"Properties": {},
"SystemProperties": {
"connectionDeviceId": "Device1",
"connectionAuthMethod": "{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}",
"connectionDeviceGenerationId": "637425408342887985",
"contentType": "application/json",
"contentEncoding": "utf-8",
"enqueuedTime": "2021-06-17T22:00:47.2170000Z"
},
"Body": {
"topic": {
"namespace": "spBv1.0",
"edgeNodeDescriptor": "Routed Group/E2",
"groupId": "Routed Group",
"edgeNodeId": "E2",
"deviceId": "D2",
"type": "DBIRTH"
},
"payload": {
"timestamp": "2021-06-17T22:00:47.082Z",
"metrics": [{
"name": "Ramp1",
"timestamp": "2021-06-17T22:00:47.082Z",
"dataType": "Int32",
"metaData": {},
"properties": {
"Quality": {
"type": "Int32",
"value": 192
},
"My Property": {
"type": "String",
"value": "{\"\":\"\"}"
}
},
"value": 77
}],
"seq": 1
}
}
}
I found documentation showing that my array of 'metrics' is supported as shown here:
https://learn.microsoft.com/en-us/azure/time-series-insights/concepts-json-flattening-escaping-rules
With this message, I can see 'Ramp1' show up in TSI with a value and timestamp as expected. However, the 'properties' under each metric do not show up. In this example that is 'Quality' and 'My Property'. Is there a way to get this data into TSI with an association to 'Ramp1'?

Microsoft graph user delta - manager issue

When I try to get users via the delta endpoint:
https://graph.microsoft.com/v1.0/users/delta?$select=id,displayName,manager
The returned response will contain some users with the manager property defined, as expected:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,manager)",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/users/delta?$skiptoken=[token]",
"value": [
{
"displayName": "user1",
"id": "id1"
},
{
"displayName": "user2",
"id": "id2",
"manager#delta": [
{
"#odata.type": "#microsoft.graph.user",
"id": "managerId1"
}
]
},
{
"displayName": "user3",
"id": "id3"
},
// etc
]
}
However when I then query the returned nextLink to get the second page, the same set of users are returned as the first page, and this time without any managers. Also note that the #odata.context value has changed now too:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#users",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/users/delta?$skiptoken=[token]",
"value": [
{
"displayName": "user1",
"id": "id1"
},
{
"displayName": "user2",
"id": "id2"
},
{
"displayName": "user3",
"id": "id3"
},
... etc
]
}
When I remove the displayName property, so am only selecting for id and manager, the paging seems to work correctly:
https://graph.microsoft.com/v1.0/users/delta?$select=id,manager
The issue has been reproduced when including the userPrincipalName property in the $select too.

How to differ Site Page and Wiki Page in MS Graph or SharePoint REST API

I created a SharePoint Page in SitePages library using the new SharePoint online experience. The page was created and I tried to fetch the page properties using MS Graph endpoint:
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/site_page.aspx?expand=listItem
The response I got:
{
...
"name": "site_page.aspx",
...
"file": {
"mimeType": "application/xml",
"hashes": {
"quickXorHash": ""
}
},
...
"listItem": {
...
"id": "4",
...
"contentType": {
"id": "0x0101009D1CB255DA76424F860D91F20E6C411800020BAE24978F3545AFD24007B325ACF9"
},
"fields": {
"FileLeafRef": "site_page.aspx",
"Title": "site_page",
"LinkTitle": "site_page",
"id": "4",
"ContentType": "Site Page",
...
}
}
}
Then I added Wiki Page content to this library to support Wiki pages in my site.
I created a new Wiki Page and fetched the page properties again using MS Graph endpoint:
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/wiki_page.aspx?expand=listItem
The response I got:
{
...
"name": "wiki_page.aspx",
...
"file": {
"mimeType": "application/xml"
},
...
"listItem": {
...
"id": "5",
...
"contentType": {
"id": "0x0101009D1CB255DA76424F860D91F20E6C411800020BAE24978F3545AFD24007B325ACF9"
},
"fields": {
"FileLeafRef": "wiki_page.aspx",
"Title": "wiki_page",
"LinkTitle": "wiki_page",
"id": "5",
"ContentType": "Site Page",
"WikiField" : "..."
...
}
}
}
As you can see both items have the same Content Type. How that is possible?
The only difference being that the wiki_page Item doesn't include 'hashes' property and does include 'WikiField' property (the place where the wiki page content is stored).
Is there another way to distinguish page types?
You could try this endpoint: GET /sites/{site-id}/lists/{list-id}/items?expand=fields(select= ContentType)
My test result:
{
"#odata.etag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"createdDateTime": "2020-04-22T05:34:06Z",
"eTag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"id": "11",
"lastModifiedDateTime": "2020-04-22T05:34:06Z",
"webUrl": "https://xxxx.sharepoint.com/sites/dev/SitePages/wikipage.aspx",
"createdBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"lastModifiedBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"parentReference": {
"id": "79e13173-d5ee-4a17-a081-5c94d148f905",
"siteId": "xxxx.sharepoint.com,b57886ef-4c2a-4d56-ad29-27266638ac3b,b62d1450-8e6f-4be7-84a3-f6600fd6cc14"
},
"contentType": {
"id": "0x01010800511BB12BD4FB664A89516226DBDDF1FB"
},
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('11')/fields/$entity",
"fields": {
"#odata.etag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"ContentType": "Wiki Page"
}
},
{
"#odata.etag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"createdDateTime": "2020-04-22T05:35:54Z",
"eTag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"id": "12",
"lastModifiedDateTime": "2020-04-22T05:35:54Z",
"webUrl": "https://xxxx.sharepoint.com/sites/dev/SitePages/webpartpage.aspx",
"createdBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"lastModifiedBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"parentReference": {
"id": "79e13173-d5ee-4a17-a081-5c94d148f905",
"siteId": "xxxx.sharepoint.com,b57886ef-4c2a-4d56-ad29-27266638ac3b,b62d1450-8e6f-4be7-84a3-f6600fd6cc14"
},
"contentType": {
"id": "0x0101090100FAC6DAD225005749BE7D6124B50B156E"
},
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('12')/fields/$entity",
"fields": {
"#odata.etag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"ContentType": "Web Part Page"
}
}
You'd better check the type of your page.
Updatded:
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('13')/fields/$entity"
"fields": {
"#odata.etag": "\"18361706-416b-4a71-8d31-bce87c1a57e4,3\"",
"ContentType": "Site Page"
}

Resources