title: Accessing CRM Dynamics 365 data using Service Root URL for Web API
body: <p>My issue is accessing the Dynamics CRM 365 data in RESTful service.</p>
  
  <p>I want to use Dynamics CRM data in a RESTful service. This RESTful service will be used in an WCF services to connect a mobile application to CRM data access.</p>
  
  <p>I have gone through below reference but does not looks like any of them will work for me. Here, I want to try to avoid the use of Azure.</p>
  
  <p>For above requirement, I tried with <strong>CODE</strong> provided in below reference:
  <a href="https://code.msdn.microsoft.com/CRM-Web-API-Query-Data-2d36c28c" rel="nofollow noreferrer"><strong>Ref 1:</strong> Microsoft CRM Web API Query Data Sample (CS)</a>,
  but that is also giving the error as attached <strong>screenshot</strong></p>
  
  <p><a href="https://i.stack.imgur.com/a9Spu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a9Spu.png" alt="Error ScreenShot"></a></p>
  
  <p><strong>Error zone</strong>: In Program.cs file - when it tries to get the result throws error on below line of code:</p>
  
  <pre><code>HttpResponseMessage response = SendAsJsonAsync(httpClient, HttpMethod.Post,
              "accounts", account1).Result;
  </code></pre>
  
  <p>If link shared above as <strong>Ref 1</strong> is the correct way than how am I supposed to get <strong>ClientId</strong> and <strong>RedirectUrl</strong>?</p>