我是SPFX框架和MSGraph API的新手。Microsoft Graph API中的趨勢
我的要求是顯示我周圍趨勢的項目,因此使用API(https://graph.microsoft.com/beta/me/insights/trending)。在響應中,顯示PreviewImageURL(這是onedrive API)。
我想綁定到img標籤的url,但得到了破碎的圖像。如何顯示PreviewImageURL?
我是SPFX框架和MSGraph API的新手。Microsoft Graph API中的趨勢
我的要求是顯示我周圍趨勢的項目,因此使用API(https://graph.microsoft.com/beta/me/insights/trending)。在響應中,顯示PreviewImageURL(這是onedrive API)。
我想綁定到img標籤的url,但得到了破碎的圖像。如何顯示PreviewImageURL?
作爲一個beta端點,它可能非常棘手,但基於我在Graph Explorer中看到的(see here),previewImageUrl
是對SharePoint REST API的調用。
這些URL的原型看起來像https://{tenant}.sharepoint.com/_api/v2.0/drives/{drive-id}/items/{item-id}/thumbnails/0/small/thumbnailContent
。換句話說,這個URL代表對SharePoint API的調用,而不是圖像本身的URL。
盡我所知,目前沒有辦法通過Graph獲取此圖。但是,您應該可以再次撥打previewImageUrl
來獲取對象。請記住,這需要您在授權期間請求額外的範圍以涵蓋SharePoint API。