0
votes

I'm using Sharepoint v1.0 API and want to retrieve a file by it's document id. I can't find any documentation on how to retrieve a file this way. If I use the URL:

https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_layouts/15/DocIdRedir.aspx?ID=MLVDK4UWQQ8B-763006743-3089

The response is a 401 so direct calls don't work. I can query the API but I don't know how to translate the above URL to an URL I can use with that API. The URL should be something like:

https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/

What is the correct way to retrieve the document using the API? I've tried:

2

2 Answers

0
votes

Try to use DocId=MLVDK4UWQQ8B-763006743-3089 in search rest api:

https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?querytext='DocId=MLVDK4UWQQ8B-763006743-3089'

Reference:

Search By Document ID In SharePoint 2013

0
votes

I know that is not an official API endpoint you are maybe looking for but if you want to download the document with SharePoint url you may try to use the download.aspx like https://xxxxxxx.sharepoint.com/sites/xxxxx/_layouts/15/download.aspx?UniqueId=MLVDK4UWQQ8B-763006743-3089

I hope this will be of any help