Error uploading file with Google Drive as impersonated user

Hi there,

I’ve been running into issues uploading files to Google Drive through a service account.

I’m using a service account key, and recently got the error:
“Upload File: Upload failed after 0 bytes. Google.Apis.Requests.RequestError The user’s Drive storage quota has been exceeded. [403]”

It looks like the storage quota for the service account has been hit, so in order to work around this I attempted to upload to a user account using impersonation in the GSuite Application Scope. All permissions and scopes have been enabled within the Google Service account, however now I’m getting this error:
“Upload File: Upload failed after 0 bytes. Error:“unauthorized_client”, Description:“Client is unauthorized to retrieve access tokens using this method, or client not authorized for any of the scopes requested.”, Uri:”“”

Would anybody know any solutions to this?

As it hasn’t been working for a while, I think my next option is to create a new service account, however, in time we will run into the same issue, so it would be preferable to use the impersonation feature rather than another service account.