title: Onenote API, strange behavior when PATCH from JavaScript
body: <p>I have a Kendo Editor in my web, and a button to save the content to OneNote.</p>
  
  <p>The save button calls this function:</p>
  
  <pre><code>updatePageContent: function (pageId, elementId, content) {
          deferred = $q.defer();
  
          var Request = new XMLHttpRequest();
  
          Request.open('PATCH', 'https://www.onenote.com/api/beta/pages/' + pageId + '/content');
  
          Request.setRequestHeader('Content-Type', 'application/json');
          Request.setRequestHeader('Authorization', 'Bearer ' + onenoteApi.token);
  
          Request.onreadystatechange = onPageUpdated;
  
          var body = [{
                'target': elementId,
                'action': 'replace',
                'content': '&lt;div data-id=content&gt;' +
                                  content +
                           '&lt;/div&gt;'
          }]
  
          Request.send(JSON.stringify(body));
  
          return deferred.promise;
      }
  </code></pre>
  
  <p>And Works fine the first two times, but when I try one third time, something strange happens.</p>
  
  <p>Example:</p>
  
  <p>I have a default paragraph with a text and I add another one:</p>
  
  <blockquote>
    <p>Default text</p>
    
    <p>bla1</p>
  </blockquote>
  
  <p>Save and well. So I add another paragraph:</p>
  
  <blockquote>
    <p>Default text</p>
    
    <p>bla1</p>
    
    <p>bla2</p>
  </blockquote>
  
  <p>Save and well. Another one:</p>
  
  <blockquote>
    <p>Default text</p>
    
    <p>bla1</p>
    
    <p>bla2</p>
    
    <p>bla3</p>
  </blockquote>
  
  <p>Save, and this is the result in onenote:</p>
  
  <blockquote>
    <p>bla1</p>
    
    <p>Default text</p>
    
    <p>bla1</p>
    
    <p>bla2</p>
    
    <p>bla3</p>
  </blockquote>
  
  <p>And blocks de page, if I try to PATCH again, I have an access denied error.</p>