Download files from google drive via the api


I’m trying to download a file that from Pipedrive that is connected to google drive. The code below works for files that have a public link. However, when the link in google drive isn’t publicly available this won’t work.

Is there a way to get the connected drive account to use as credentials for the download here?
Or is there another way rather than make the file public?

Best Regards,

This is not for the pipedrive community but rather an google api question. Read this documentation. At the bottom there are links to client libraries for Java/.NET