I am using the Gmail API to put messages into a Google Apps email account. I use the OAuth 2.0 authentication protocol with a service account. This is more or less working fine. One of our customers has asked us to put messages directly into a Google Vault. I don't see a Vault API, but I did find this information related to the "insert" method (which is what we use to add messages to a normal account):
parameter "deleted" (boolean): Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts.
When I do this, some messages are accepted, but frequently I get http error 500 in response to the POST. The error text says "Backend Error". I thought the pattern was that the first time the message was posted, it would work, but the second time would generate the error. Therefore I was thinking it was a duplicate check issue. However I now see some examples of messages that fail immediately. The POST url looks like this:
As I mentioned, the same message to the same url (without deleted=true) will always work. Any ideas what is causing the error?
https://mail.google.com/in your scopes? :) I'm just guessing here. - Tholle