title: MS Graph API: microsoft.graph.createLink not creating anonymous view links
body: <p>I'm using graph API to iterate over a folder in OneDrive for Business.  I'm attempting to generate "anonymous view" links for each item in the folder using the following call:</p>
  
  <p><code>/v1.0/users('user-guid')/drive/items/item-id/microsoft.graph.createLink</code></p>
  
  <p>with the body:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
     "type": "view",
     "scope": "anonymous"
  }
  </code></pre>
  
  <p>This works correctly for items that have already been given the "View link- no sign-in required" permission via the OneDrive UI. However, executing this call against an item that doesn't have this sharing option already set, results in the following return message:</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "error": {
      "code": "unauthenticated",
      "message": "The caller is not authenticated.",
      "innerError": {
      "request-id": "1c3600ec-4861-4be4-9a7b-74264f488a80",
      "date": "2016-03-13T02:30:10"
      }
    }
  }
  </code></pre>
  
  <p>I know that this is not an authentication issue because my token works fine for all other calls (and calls against items that already have their file sharing set).  I get the same behavior from the <a href="https://developer.microsoft.com/en-us/graph/graph-explorer" rel="nofollow noreferrer">Microsoft Graph Explorer</a> tool.  If I manually set the "View link - no sign-in required" permission in OneDrive this call executes perfectly.  My credentials for the API call are the same credentials I'm using to set the permissions in the OneDrive UI.</p>
  
  <p>The documentation for <a href="https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/item_createlink" rel="nofollow noreferrer">microsoft.graph.createLink</a> states</p>
  
  <blockquote>
    <p>The createLink method will create a new sharing link if the specified link type doesn't already exist. If a sharing link of the specified type already exists for the app, the existing sharing link will be returned.</p>
  </blockquote>
  
  <p>Any ideas what's going wrong here?</p>