edoc content services Guide
Breadcrumbs

Retrieve a view of a file

Method and endpoint

GET /Documents/{documentId}/view

You can use the method and endpoint GET /Documents/{documentId}/view to directly retrieve the content of a document file from the destination system. This function is suitable for displaying a preview of the file in the browser, for example.

If you would like to download a file, you will find further information under: Download a file

A Content-Type header is returned in the response, so that you can handle PDF files in your application or service differently to text files, for example.

Example of a request

GET /Documents/762f8698-f605-4de5-89fb-6f5fff3435fd/view
Accept: application/json
ModuleId: sharepoint
ConnectionString: targetHost=https://test.sharepoint.com;User=MyUserName;Password=MyPassword;ListId=MyListId;

Example of a response

This is a text from a text file. The text was returned by edoc content services.