0

I want to get a public URL to get the images of a list column using the graph API When using the sharepoint REST API I could do it this way:

https://mysite.sharepoint.com/sites/namesite/_api/web/lists/getbytitle('Jobs')/RenderListDataAsStream

"Image": {
            "fileName": "PM.png",
            "serverRelativeUrl": "/sites/sitename/SiteAssets/Lists/32621fcf-e08c-4e3e-91ee-73pfe37752pm8/BD.png",
            "id": "b21f223d-e9af-41d5-80a3-db89dd7b10d2",
            "serverUrl": "https://mysite.sharepoint.com",
            **"thumbnailRenderer": {
                "spItemUrl": "https://mysite.sharepoint.com:443/_api/v2.1/drives/b!Gtl2BVcgkW_CHn3DwqYuAqWL0zDWtdEi1xPlBGSybE19ol3o3brR6hD0A5zU1Vr/items/01365JYLYB5EIP3FL7J2VAYBI63RHOXJHST",**
                "fileVersion": 2,
                "sponsorToken": "P2VPDdGVzL3Rlc3RsYW5kaW5nL0xpc3RzL1N1YiBTZWN0aW9ufEltYWdlfka"
            }
        },

I got the thumbnailRenderer->spItemUrl this when doing another query to that url brings me a public url with a token and this is the one that allowed me to get the image but I can't replicate this using graph API

Beforehand thank you very much

1 Answer 1

0

You can extract from the "spItemUrl" the drive id and the drive item id.

With them, you can use graph api:

graphClient.Drives[pDriveId].Items[pDriveItemId].Content.Request().GetAsync();

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.