I am using below code to get the information about Sharepoint document:
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApp1
{
class Class1
{
static void Main(string[] args)
{
//make changes based on your site url
HttpWebRequest endpointRequest =(HttpWebRequest)HttpWebRequest.Create("https://company.sharepoint.com/_api/search/query?querytext='docName");
endpointRequest.Method = "GET";
endpointRequest.Accept = "application/json;odata=verbose";
endpointRequest.Headers.Add("Authorization","Bearer " + accessToken);
HttpWebResponse endpointResponse =(HttpWebResponse)endpointRequest.GetResponse();
}
}
}
But I am getting below errors:
Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'SharePoint' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) ConsoleAppSP C:\Program.cs 1 Active
How to add Microsoft Sharepoint library to Visual studio 2019 Preview?
(I am new to C#, Visual Studio and SharePoint).