Authentication with the Web API

Any request executed via the Web API will need to be authenticated with the Dynamics CRM instance. The only exceptions are the requests that are executed inside the web resources and plugins deployed in the organization itself.

The possible scenarios are as follows:

       HttpWebRequest request = 
(HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.Credentials =
new NetworkCredential(UserName, PassWord);
       UserCredential userCredential = new UserCredential("
<office 365 user name>", "<Office 365 Password>");