Forum Discussion
iainmac
Jul 01, 2019Copper Contributor
SharePoint 365 Rest API: Add a link item in a document library
Hi I am looking into creating a new link item in a document library using rest api. I have looked around and can not find a solution as yet. Has anyone managed to achieve this? Many thank...
AugustGeier
Nov 04, 2021Copper Contributor
I was able to do this via the MS Graph API. For those that this may help:
MS Graph API version: 1.0
Method: PUT
URL: https://graph.microsoft.com/v1.0/sites/{site_id}/drive/root:/name of link that can contain spaces.url:/content
Request Headers: content-type text/plain
Request Body (separate lines are important here):
[InternetShortcut]
URL=https://some.website.com/path/more_path
MS Graph API version: 1.0
Method: PUT
URL: https://graph.microsoft.com/v1.0/sites/{site_id}/drive/root:/name of link that can contain spaces.url:/content
Request Headers: content-type text/plain
Request Body (separate lines are important here):
[InternetShortcut]
URL=https://some.website.com/path/more_path