Skip to content

Gdrive upload national roster csv

David Taylor requested to merge gdrive-upload-national-roster-csv into dev

Adds google drive service with file upload method. Also adds mostly stubbed endpoint for getting a parsed CSV attachment in a POST, and uploads to the gdrive folder configured. Account adding and merging is stubbed pending a more definitive merge strategy.

The mail parsing service used is mailparser.io. For this I set up email parsing rules to send a POST with a body with the following schema:

{
    <Message metadata, ignored>,
    "mail-attachment": "<file contents as str>",
    "mail-attachment-filename": "<filename of attachment>"
}

Any service that can parse an email into this schema should be appropriate. Hitting the endpoint requires the X-Api-Key header set (configured in .env).

For the google drive setup, Drive API needs to be enabled and a service account created. The credentials.json should live under the root directory, with the path specified in the .env file.

Merge request reports

Loading