2

I uploaded a file to a user's OneDrive using the Web Interface and then I fetched the file information using two APIs: MS Graph API and SharePoint REST API.

For MS Graph API I used the following endpoint:

https://graph.microsoft.com/v1.0/drives/b{drive-id}/items/{item-id}

and the respose I got:

{
    ***
    "createdDateTime": "2019-12-09T15:03:52Z",
    "eTag": "\"{9E8670D4-185F-4E8D-B2E5-61819E769BC3},2\"",
    "lastModifiedDateTime": "2019-12-09T15:04:12Z",
    "name": "test.psd",
    "cTag": "\"c:{9E8670D4-185F-4E8D-B2E5-61819E769BC3},2\"",
    "size": 56783858,

    "lastModifiedBy": {
        "user": {
            "email": "batman@keepitdev02.onmicrosoft.com",
            "id": "6e14d588-63db-46e4-b70d-0f00050dafa4",
            "displayName": "Batman"
        }
    },
    "fileSystemInfo": {
        "createdDateTime": "2019-12-09T15:03:52Z",
        "lastModifiedDateTime": "2019-12-09T15:04:12Z"
    },
    ***
}

For the SharePoint REST API I used the endpoint:

https://*my.sharepoint.com/personal/*/_api/Web/GetFileByServerRelativePath(decodedurl='*/test.psd')

The response I got:


        "LinkingUrl": "",
        "MajorVersion": 1,
        "MinorVersion": 0,
        "Name": "test.psd",
        "ServerRelativeUrl": "/*/test.psd",
        "TimeCreated": "2019-12-09T15:03:52Z",
        "TimeLastModified": "2019-12-09T15:04:11Z",
        "Title": null,
        "UIVersion": 512,
        "UIVersionLabel": "1.0",
        "UniqueId": *
}

The modification time that APIs returned are:

  • MS Graph: 2019-12-09T15:04:12Z

  • SharePoint REST API: 2019-12-09T15:04:11Z

    As you can see they are different by 1 second. Can someone explain why do I see such a difference?

Community
  • 1
  • 1

0 Answers0