Hi,
Please check the section on how to handle API errors in our docs, specifically the part about HTTP response code 503:
https://developers.google.com/google-apps/documents-list/#handling_api_errors
Claudio