title: Get a List from Office365 using REST API
body: <p>I want to get a SP2013 list and I can't use CSOM. I've registered my app (a cmd test app, not a SP hosted one) on Sharepoint and have a clientId and clientSecret.</p>
  
  <p>But when I submit the Authorize Url that I built:</p>
  
  <pre><code>https://mysite.sharepoint.com/_layouts/15/OAuthAuthorize.aspx?client_id=&lt;myclientId&gt;&amp;scope=list.read&amp;response_type=code&amp;redirect_uri=https%3A%2F%2Fwww.google.com
  </code></pre>
  
  <p>I get a http403 on fiddler.</p>
  
  <p>or</p>
  
  <p>when I request it from a browser I get redirected to:</p>
  
  <pre><code>https://www.google.com/?error=invalid_scope&amp;error_description=The%20scope%20list%2Eread%20is%20not%20valid%2E
  </code></pre>
  
  <p>which is my redirect_uri but with the error "invalid scope". I've tried to use the scope uri (instead of the alias) and got the same response.</p>
  
  <p>Note that I'm also authenticaded when I make the request from the browser. Otherwise I get redirected to the login page.</p>
  
  <p><strong>How can I get an access token to make REST requests to Sharepoint</strong>?</p>
  
  <hr>
  
  <p>Here is a longer description of what I'm trying to do:</p>
  
  <p>I’ve got a sharepoint list at <code>https://mysite.sharepoint.com/</code>. (the location is actually: <code>https://mysite.sharepoint.com/_layouts/15/start.aspx#/Lists/TestTasksList</code>)</p>
  
  <p>And I want to query it from an android app. So far I have and android app built using xamarin to create tasks. 
  I can’t use the client side object model. So the only option is using the Rest Api. 
  I have tried to create a simple .net cmd line app to query the rest api but I can’t find a way to authenticate. I think I need to use OAuth but even after getting the clientId and clientsecret I can’t manage to make requests. I can’t get an access token.</p>
  
  <p>Most code samples that I found are for sharepoint applications to be deployed in the cloud and they seem to ignore the authentication bit (or just using default credentials).</p>
  
  <p>I managed to authenticate and query the list using the CSOM in a .net cmd app. But I can’t find a way to do it using the rest api.
  I know we can use the legacy web services (from SP2010) but that won’t work as a long term solution.</p>
  
  <p>So the bottom line is querying a list in Office 365 from a console app using the REST api.</p>