0
votes

Using MS Graph API /beta endpoint to figure out if the list has been updated/changed.

Used the following query first:

https://graph.microsoft.com/beta/sites/xxxxx.sharepoint.com:/sites/xxxxx?$expand=lists(select=id, name, system, lastModifiedDateTime)

And did get the following date:

"lastModifiedDateTime": "2018-10-08T10:23:37Z",

But when going against the items and see the dates on the latest item with the following query: https://graph.microsoft.com/beta/sites/xxxxx.sharepoint.com,92af4fbc-04bc-46d8-9c78-f63832fbf48a,1b59d85a-41bd-4498-a64c-17bd13069d90/lists/b9c39323-076a-4ae7-942b-1d0060a6b352/items

you can see the dates:

"createdDateTime": "2018-10-08T10:23:37Z"

"lastModifiedDateTime": "2018-10-08T10:29:14Z",

You can see that lastModifiedDateTime property on the list looks like actually lastCreatedDateTime?

Best Regards, Kim

edit:

First graph request gets the SitePages list and its lastModifiedDateTime:

    {
        "id": "b9c39323-076a-4ae7-942b-1d0060a6b352",
        "lastModifiedDateTime": "2018-10-08T10:23:37Z",
        "name": "SitePages",
        "system": {}
    },

But if we then look at the items of the list, we can see that it has an item with a higher lastModifiedDateTime (second graph request):

        "createdDateTime": "2018-10-08T10:23:37Z",
        "eTag": "\"27e03a98-9321-4586-8ef1-0b5323c26730,6\"",
        "id": "8",
        "lastModifiedDateTime": "2018-10-08T10:29:14Z",

We can also see that the createdDateTime of the listitem is the same as the list lastModifiedDateTime. Looks like a bug in the api to mee. The date in the first request should be "2018-10-08T10:29:14Z". Dont you agree?

2

2 Answers

0
votes

As your description, I assume you want to know why the LastModifyDateTime is different.

Base on my test, your first link is to get the lastModifyDateTime of the special site, but your second link is about the items of the b9c39....

We can use the MS Graph Explore to check whether this two site has some differences.

0
votes

Indeed, it appears to be a bug, for List resource lastModifiedDateTime property returns invalid value, it seems to be mapped to the last list item date and time when the item was created (ListItem.createdDateTime)

It could also be confirmed as a bug using the following endpoints (in both examples a valid lastModifiedDateTime value is returned):

Meanwhile as a workaround the following solution could be considered to enumerate site lists:

https://graph.microsoft.com/beta/sites/{site-id}/drives?expand=root(select=lastModifiedDateTime)

where root/lastModifiedDateTime returns a valid value

Limitation: Only returns document libraries