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:

* [https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/\_api/search/query?refinementfilters=DlcDocId:equals("MLVDK4UWQQ8B-763006743-3089")](https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?refinementfilters=DlcDocId:equals(%22MLVDK4UWQQ8B-763006743-3089%22))
* [https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/\_api/search/query?DlcDocId='MLVDK4UWQQ8B-763006743-3089'](https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/search/query?DlcDocId=%27MLVDK4UWQQ8B-763006743-3089%27)
* https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/\_api/Web/GetFolderByServerRelativeUrl('Shared
Documents')/Files
* [https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/\_api/Web/GetFileByServerRelativeUrl('\_layouts/15/DocIdRedir.aspx?ID=MLVDK4UWQQ8B-763006743-3089')/Versions](https://xxxxxxxx.sharepoint.com/sites/xxxxxxx/_api/Web/GetFileByServerRelativeUrl(%27_layouts/15/DocIdRedir.aspx?ID=MLVDK4UWQQ8B-763006743-3089%27)/Versions)