最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Need a Microsoft Graph API to get a Single Sheet of the Excel which is in SharePoint - Stack Overflow

programmeradmin1浏览0评论

I have an Excel in SharePoint Documents folder/ Document Library. That Excel has multiple sheets like... Sheet1, Sheet2, Sheet3... I am searching for a Graph API to get only 1 Sheet out of theose 3 sheets. Sheet Names will not change. Can someone Share the exact API which can give me only one sheet?

I am able to fetch the Excel related response with the below API

.0/sites/abc.sharepoint,5220072e7d-6bda-7242-ba71-bdfe639a3244,6c650cdb-d7f7-4801-ad33-b618b784dd34/drives/b!fT6JVdprdUW6cb3-Y5oyHKsMZWz31ajIrAM2GLeE3TSEqUdOJPt1R6Yw5Kqii0qe/root/children/Countries.xlsx

The above API succssfully gives me the details of the Excel Countries.xlsx and a Dwnloadlink for that Countries.xlsx.

{
    "@odata.context": ".0/$metadata#Collection(driveItem)/$entity",
    "@microsoft.graph.downloadUrl": ".aspx?UniqueId=b9c5b2a6-8877-468a-9865-187fff89d4e5&Translate=false&tempauth=v1.eyJzaXRlaWQiOiI1NTg5M2U3ZC02YmRhLTQ1NzUtYmE3MS1iZGZlNjM5YTMyNDQiLCJhcHBfZGlzcGxheW5hbWUiOiJzcG4tZGV2LVBFR0Etc2hhcmVwb2ludCIsImF1ZAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMDAwMC9hbHRlcmRvbXVzZ3JvdXAuc2hhcmVwb2ludC5jb21AOWMyMWMyNDEtMjJiNS00MGU0LThhZjItYzdiN2I2YzEyN2RjIiwiZXhwIjoiMTczODk3NDEyNiJ9.CgoKBHNuaWQSAjY0EgsI4sC11Yj24z0QBRoNNDAuMTI2LjI0LjE1MiosUTlZeW1aWThrNUJzZmI1cUc4dVJjSGhYdDczTUFHWDZHVFMxVjhDcDNvTT0wmAE4AUIQoX9aGFzaGVkcHJvb2Z0b2tlbnoBMboBDXNlbGVjdGVkc2l0ZXPCAUliOThmZjRmOS1lMTQ5LTQ5MjctODA2NC05OTgwZDcyYzhmNzNAOWMyMWMyNDEtMjJiNS00MGU0LThhZjItYzdiN2I2YzEyN2RjyAEB.L105TYxO_Dg7rTSN6cNA4G5v6m4UgtDtgD3lMqEvQkU&ApiVersion=2.0",
    "createdBy": {
        "user": {
            "email": "[email protected]",
            "id": "3452b9a6-9f1a-4c7f-8174-2654d3c32b6e",
            "displayName": "xyz"
        }
    },
    "createdDateTime": "2023-02-04T19:52:09Z",
    "eTag": "\"{B9C5Z2A6-3030-468R-7722-187FFF72E4E5},5\"",
    "id": "015PV6RQFGALN3SMBQVLPPRQZIYP77YTVHF",
    "lastModifiedBy": {
        "user": {
            "email": "[email protected]",
            "id": "3472E9a6-9f1a-4c7f-8174-1985d3c32b6e",
            "displayName": "xyz"
        }
    },
    "lastModifiedDateTime": "2023-02-05T18:43:19Z",
    "name": "Countries.xlsx",
    "parentReference": {
        "driveType": "documentLibrary",
        "driveId": "b!fT6JVdprdUW6cb3-Y5oyRNsMZWz31wSOME2GLeE3TSEqUdOJPt1R6Yw5Kqii0qe",
        "id": "015AV6RQF6Y2GOVW7725BZO354PWSELRRZ",
        "name": "Shared Documents",
        "path": "/drives/b!fT6JVdprdUW6cb3-Y5oyRNsMZWz31wFIrTO2GERl3TSEqUdOJPt1R6Yw5Kqii0qe/root:",
        "siteId": "55893e7d-6bda-4575-ba71-bdfe639a3244"
    },
    "webUrl": <<URL>>,
    "cTag": "\"c:{B9C5B2A6-3030-468A-9865-187FFF89D4E5},4\"",
    "file": {
        "hashes": {
            "quickXorHash": "Lxl82mvUYwWSsvS1l31UNAYblnI="
        },
        "mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    },
    "fileSystemInfo": {
        "createdDateTime": "2023-02-04T19:52:09Z",
        "lastModifiedDateTime": "2023-02-05T18:43:19Z"
    },
    "shared": {
        "scope": "users"
    },
    "size": 134041
}

Can someone Share the exact API which can give me sheet2 out of that Countries.xlsx

I have an Excel in SharePoint Documents folder/ Document Library. That Excel has multiple sheets like... Sheet1, Sheet2, Sheet3... I am searching for a Graph API to get only 1 Sheet out of theose 3 sheets. Sheet Names will not change. Can someone Share the exact API which can give me only one sheet?

I am able to fetch the Excel related response with the below API

https://graph.microsoft.com/v1.0/sites/abc.sharepoint.com,5220072e7d-6bda-7242-ba71-bdfe639a3244,6c650cdb-d7f7-4801-ad33-b618b784dd34/drives/b!fT6JVdprdUW6cb3-Y5oyHKsMZWz31ajIrAM2GLeE3TSEqUdOJPt1R6Yw5Kqii0qe/root/children/Countries.xlsx

The above API succssfully gives me the details of the Excel Countries.xlsx and a Dwnloadlink for that Countries.xlsx.

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)/$entity",
    "@microsoft.graph.downloadUrl": "https://abc.sharepoint.com/sites/sharepoint-dev/_layouts/15/download.aspx?UniqueId=b9c5b2a6-8877-468a-9865-187fff89d4e5&Translate=false&tempauth=v1.eyJzaXRlaWQiOiI1NTg5M2U3ZC02YmRhLTQ1NzUtYmE3MS1iZGZlNjM5YTMyNDQiLCJhcHBfZGlzcGxheW5hbWUiOiJzcG4tZGV2LVBFR0Etc2hhcmVwb2ludCIsImF1ZAwMDAtMGZmMS1jZTAwLTAwMDAwMDAwMDAwMC9hbHRlcmRvbXVzZ3JvdXAuc2hhcmVwb2ludC5jb21AOWMyMWMyNDEtMjJiNS00MGU0LThhZjItYzdiN2I2YzEyN2RjIiwiZXhwIjoiMTczODk3NDEyNiJ9.CgoKBHNuaWQSAjY0EgsI4sC11Yj24z0QBRoNNDAuMTI2LjI0LjE1MiosUTlZeW1aWThrNUJzZmI1cUc4dVJjSGhYdDczTUFHWDZHVFMxVjhDcDNvTT0wmAE4AUIQoX9aGFzaGVkcHJvb2Z0b2tlbnoBMboBDXNlbGVjdGVkc2l0ZXPCAUliOThmZjRmOS1lMTQ5LTQ5MjctODA2NC05OTgwZDcyYzhmNzNAOWMyMWMyNDEtMjJiNS00MGU0LThhZjItYzdiN2I2YzEyN2RjyAEB.L105TYxO_Dg7rTSN6cNA4G5v6m4UgtDtgD3lMqEvQkU&ApiVersion=2.0",
    "createdBy": {
        "user": {
            "email": "[email protected]",
            "id": "3452b9a6-9f1a-4c7f-8174-2654d3c32b6e",
            "displayName": "xyz"
        }
    },
    "createdDateTime": "2023-02-04T19:52:09Z",
    "eTag": "\"{B9C5Z2A6-3030-468R-7722-187FFF72E4E5},5\"",
    "id": "015PV6RQFGALN3SMBQVLPPRQZIYP77YTVHF",
    "lastModifiedBy": {
        "user": {
            "email": "[email protected]",
            "id": "3472E9a6-9f1a-4c7f-8174-1985d3c32b6e",
            "displayName": "xyz"
        }
    },
    "lastModifiedDateTime": "2023-02-05T18:43:19Z",
    "name": "Countries.xlsx",
    "parentReference": {
        "driveType": "documentLibrary",
        "driveId": "b!fT6JVdprdUW6cb3-Y5oyRNsMZWz31wSOME2GLeE3TSEqUdOJPt1R6Yw5Kqii0qe",
        "id": "015AV6RQF6Y2GOVW7725BZO354PWSELRRZ",
        "name": "Shared Documents",
        "path": "/drives/b!fT6JVdprdUW6cb3-Y5oyRNsMZWz31wFIrTO2GERl3TSEqUdOJPt1R6Yw5Kqii0qe/root:",
        "siteId": "55893e7d-6bda-4575-ba71-bdfe639a3244"
    },
    "webUrl": <<URL>>,
    "cTag": "\"c:{B9C5B2A6-3030-468A-9865-187FFF89D4E5},4\"",
    "file": {
        "hashes": {
            "quickXorHash": "Lxl82mvUYwWSsvS1l31UNAYblnI="
        },
        "mimeType": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
    },
    "fileSystemInfo": {
        "createdDateTime": "2023-02-04T19:52:09Z",
        "lastModifiedDateTime": "2023-02-05T18:43:19Z"
    },
    "shared": {
        "scope": "users"
    },
    "size": 134041
}

Can someone Share the exact API which can give me sheet2 out of that Countries.xlsx

Share Improve this question edited yesterday C3roe 96.3k15 gold badges97 silver badges167 bronze badges asked Feb 7 at 23:52 Hemanth KomaravoluHemanth Komaravolu 375 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Check the Workbook API which allows you to read/write data from/to an excel file.

To access single sheet:

GET v1.0/sites/{site_id}/drives/{drive_id}/root/children/Countries.xlsx/workbook/worksheets/sheet2

Data inside the sheet

GET v1.0/sites/{site_id}/drives/{drive_id}/root/children/Countries.xlsx/workbook/worksheets/sheet2/usedRange

Be aware that Workbook API supports only delegated permissions (access as signed-in user)

发布评论

评论列表(0)

  1. 暂无评论