How to decode the rest api file's data from SharePoint ?

Copper Contributor

How to decode the Rest API file's data from SharePoint ?

Step-1 ) I have integrated my application with SharePoint(online)

Step-2 ) Calling rest API to get file's content from SharePoint

Sample:-

string sharepointSiteUrl = Convert.ToString("https://abc sharepoint.com/sites/SharePointIntegrattion/_api/web/GetFolderByServerRelativeUrl('/sites/SharePointIntegrattion/Shared%20Documents/Email')/Files('Document.docx')/$value?binaryStringResponseBody=true");

So from there I am getting the response as shown in the image

I just want to get the data in their actual format (docx, pdf or etc.)image.png

 

1 Reply

Hi @Karan330,

Thanks for posting your issue here.

However this platform is used for how-to discussions and sharing best practices for building any app with .NET.Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
Best Regards,
Lan Huang