1

Currently we are trying to utilize the Office 365 API as it has some great functionality and for most of it it is great. We are though having some problems with the Drive functionality.

https://graph.microsoft.com/beta/sharepoint/sites/842ff63f-5d20-4e2a-886c-6344fe3fedb1,89faa934-3419-4be6-9a03-3c67b7ba1bfc/drives

If I go to this endpoint I am returned a list of document libraries in my subsite which is great but from here i find now way to identify which document library is which.

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#drives",
    "value": [
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_xTEGyUxzw5TKpKRpkGGf2h",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_ycOhEzsgmvQobUDZT80nqH",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_xIpRvM-D0xSomYQ80n7Kpy",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_yRUGQ3zku-TLkgV2bUjyER",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_zK_31tWpo8SKHa3yiLoBFX",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_wkOMfhZ8oVQLkJxXR4T597",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_xwiFjxG1a_QrhKQ6P9MfkC",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        },
        {
            "id": "b!P_YvhCBdKk6IbGNE_j_tsTSp-okZNOZLmgM8Z7e6G_wP3lHIuea5TbTtiiR4aWe3",
            "driveType": "documentLibrary",
            "owner": {
                "user": {
                    "id": "06fecb34-dcbb-4af6-96a7-4823d0b3d2d2",
                    "displayName": "Mitchell Hunt"
                }
            },
            "quota": {
                "deleted": 12711338,
                "remaining": 106837968953,
                "state": "nearing",
                "total": 107374182400
            }
        }
    ]
}

If i go to the lists endpoint then the SharePoint GUID is used to identify the list which we can work with but the id for the drives don't seem to have any correlation to the document libraries in SharePoint.

Maybe I can expand by something to get the name but I am coming up with nothing currently other than re cursing through each library two deep and then returning the URL and splitting it to get the list name.

Can anyone help me to understand?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.