title: How to send a message successfully using the new Gmail REST API?
body: <p><strong>I'm currently trying to test the new <a href="https://developers.google.com/gmail/api/" rel="noreferrer">Gmail REST API</a></strong>.</p>
  
  <p>In the <a href="https://developers.google.com/gmail/api/v1/reference/users/messages/send#try-it" rel="noreferrer">API Explorer</a> it is possible to authorize requests using OAuth 2.0 and to execute a request, i.e. send a message. </p>
  
  <p>First I authorized.
  <img src="https://i.stack.imgur.com/G7eU1.png" alt="enter image description here"></p>
  
  <p>I'm using the following <strong>test data</strong> (and of course I used a valid <code>to</code> email address):</p>
  
  <pre><code>{    
     "raw": "c2VuZGluZyBhIG1haWwgdXNpbmcgR21haWwgUkVTVCBBUEk=",  
     "payload": { 
       "headers": [ 
         { "name": "to",      "value": "info@something.com"   }, 
         { "name": "from",    "value": "taifunbaer@gmail.com" }, 
         { "name": "subject", "value": "Test Gmail REST API"  } 
       ],
       "mimeType": "text/plain" 
     }
  }
  </code></pre>
  
  <p>I also get a <code>200 OK</code> and the following <strong>result</strong> back, which looks fine.</p>
  
  <pre><code>{
    "id": "146dee391881b35b",
    "threadId": "146dee391881b35b",
  }
  </code></pre>
  
  <p>However, the mail will not be sent successfully and I can find an message from <code>nobody@gmail.com</code> in the inbox instead;: <code>"An error occurred, your message has not been sent."</code></p>
  
  <p><img src="https://i.stack.imgur.com/qkD8e.png" alt="enter image description here"></p>
  
  <p>Questions:<br>
  <strong>1. Did someone test this successfully?<br>
  2. Do I have to add some other parameter to get this running?</strong></p>
  
  <p><br><br></p>
  
  <p><strong>EDIT</strong>: There are 2 different HTTP request methods, </p>
  
  <ol>
  <li>the Upload URI for media upload requests, and</li>
  <li>the Metadata URI for metadata-only requests</li>
  </ol>
  
  <p><code>The API Explorer currently supports metadata requests only</code>, which means plain-text messages without attachment, and this is what I'm trying to do.</p>