Getting a list of files by folder on Drive SDK

前端 未结 4 1955
轮回少年
轮回少年 2020-12-01 16:38

I am trying to build a web UI for users to navigate his/her Google Drive and select one or more documents to be referenced later on in a website from a DB. I am currently bu

4条回答
  •  广开言路
    2020-12-01 16:46

    NB This answer uses the v2 API. New applications should write to the v3 API.

    It is now possible to use the drive.files.list endpoint to list files belonging to a specific folder.

    To do so, you can use the ?q= query parameter as follows:

    GET https://www.googleapis.com/drive/v2/files?q="'' in parents"
    

    In PHP, that would be

    $service->files->list(array('q' => "'' in parents"));
    

提交回复
热议问题