title: sharepoint rest api credentials
body: <p>I'm triggering an external web page outside of sharepoint which needs to read lists using the sharepoint web api.</p>
  
  <pre><code>        HttpWebRequest endpointRequest = (HttpWebRequest)HttpWebRequest.Create(sharepointUrl.ToString() + "/_api/web/lists");
          endpointRequest.Method = "GET";
          endpointRequest.Accept = "application/json;odata=verbose";
          //endpointRequest.Headers.Add("Authorization", "Bearer " + accessToken);
          HttpWebResponse endpointResponse = (HttpWebResponse)endpointRequest.GetResponse();
  </code></pre>
  
  <p>I can access the API using chrome if I'm logged in but I suspect I need the access token line.. but can't seem to find a way to populate it.</p>
  
  <p>Currently it returns:</p>
  
  <p>No connection could be made because the target machine actively refused it...</p>