App Connect

 View Only
  • 1.  Google Drive Request

    Posted 2 days ago

    Hi! How are you?

    I'm Thaís from APERAM Brasil and I'm EAI developer.
    I have a demand where I have to read a .csv file from a path in Google Drive.
    I'm having difficulty accessing the Google Drive URL where the files are in a folder.
    Do you have any examples that could help me? Since I can't find any references on the internet on the subject.


    ------------------------------
    Thais Caldoncelli
    ------------------------------


  • 2.  RE: Google Drive Request

    Posted 2 days ago

    Hi Thais,

    To clarify the understanding of the requirement,I assume you have a predefined constant path where CSV exists and that file content needs to be extracted.

    Google Drive APIs are designed by Folder Id and Parent Folders Ids rather than PATH. Note that 2 Folders with same name can exist under single parent folder, so Path will not be able to unambiguously identify the location of the file. It is suggested to work best with Folder Id / File Id rather than Name / Path. 

    There are ways to handle this but it becomes really complex if multiple folders exist with same name. You may have to extract the leaf level folder name and Retrieve folder by Name. If the name is unique in the Drive then you are lucky to get a single folder and extract the file from it. If not you may have to validate its parent name with response parent folder id and do this recursively to ensure one of the file exactly matches. But still there is no assured way to uniquely reverse engineer a path to folder id.



    ------------------------------
    Srihari Ananda Kumar
    ------------------------------



  • 3.  RE: Google Drive Request

    Posted 15 hours ago

    I understand. So I always have to access a single folder with a unique name and extract the files from there. Could you give me an example of how to do this? I can view the drive when calling the API but I cannot view the folders.

    https://drive.google.com/drive/folders/1_1Ui1Tgy0dfJ6F86dD7VAXId5G61Fb_w



    ------------------------------
    Thais Caldoncelli
    ------------------------------