Retrieve file listings from Google Drive using Zoho Deluge API calls

I’ve set up a Google Drive integration in my Zoho CRM by going to Setup > Connections > Google and using the drive.file scope. However, I’m running into an issue when trying to fetch files from my drive.

Here’s my current code:

driveEndpoint = "https://www.googleapis.com/drive/v3/files";
apiResponse = invokeurl
[
    url : driveEndpoint
    type : GET
    connection : "my_drive_conn"
];
info apiResponse;

The response I receive shows an empty file array:

{"kind":"drive#fileList","incompleteSearch":false,"files":[]}

This is confusing because I know there are multiple files stored in my Google Drive. Interestingly, when I create a new file through Zoho, it gets saved successfully and then appears in subsequent API calls. It seems like only files created via Zoho are visible through this connection. How can I access all existing files in my drive?

double-check your connection permissions - google randomly revokes access sometimes. make sure you’re using the right google account when setting up the connection. i ran into this exact issue when i connected with my personal gmail but tried accessing work files from a different account. that empty array usually means authentication’s working fine, but permissions are blocked somewhere.

Had the same headache integrating with our internal system a few months back. It’s definitely scope-related, but there’s another angle here. Even with the right scope, Google Drive API gets weird with file visibility. Check if you’re dealing with shared files or Team Drive files - they need different endpoints. Also verify if your authenticated account actually owns the files or they’re just shared with it. Files show up in the Drive UI but won’t come back from the basic files endpoint if they’re shared from other accounts. Try adding the q parameter with ‘me’ in owners to filter for files you actually own. This helped me figure out what was actually accessible versus what just showed up in my drive interface.

Your problem is the drive.file scope - it only lets you access files your app created or opened, which is why you’re only seeing Zoho files. You need a broader scope to get all your Google Drive files. Switch from drive.file to drive.readonly in your connection settings. This gives read access to everything in your drive. You’ll have to reauthorize the connection since Google needs your permission for the expanded access. Go back to your connection settings and authorize again. Once that’s done, your code should pull all files. Just remember drive.readonly accesses everything, so make sure that works with your security needs.