I am using the Gmail API to import messages, and I have noticed the following issue. Currently I am doing a POST to this url:
https://www.googleapis.com/gmail/v1/users/me/messages?uploadType=multipart
The following http headers are set:
Content-Length: <n>
Content-Type: application/json
The posted json data looks like this:
{
"labelIds": ["Label_154"],
"raw": "RnJvbTo..."
}
(the raw data of course is a much larger based64 encoded RFC-822 message)
This works but for one customer they are getting http 413 errors on some messages, which I believe means that the message is too large. I have not yet found out how big the actual message is. I have seen some documentation that says I should use this url instead:
https://www.googleapis.com/upload/gmail/v1/users/me/messages?uploadType=multipart
But then the API complains that json is not supported, I should use Content-Type message/rfc822. I was hoping to continue to use json and raw encoded data so I don't have to make substantial changes to my code. Can you tell me what the actual message size limit is for this method, and is there a way I can go up to the full 35mb limit using a different endpoint?