2016-12-23 11 views
2

私はPHPでGoogleドライブAPI v3を使用しています。私はGoogleドキュメント - application/vnd.google-apps.documentを持っています。GoogleドライブApi-google-apps.document - 変更時刻を取得

最終変更日時はどのようにして取得できますか?

私が試した:

$this->getClient()->files->get($id,[]); 

と空の取得をすべての詳細、最終更新日時を取得する方法?

Google_Service_Drive_DriveFile {#1362 ▼ 
    #collection_key: "spaces" 
    +appProperties: null 
    #capabilitiesType: "Google_Service_Drive_DriveFileCapabilities" 
    #capabilitiesDataType: "" 
    #contentHintsType: "Google_Service_Drive_DriveFileContentHints" 
    #contentHintsDataType: "" 
    +createdTime: null 
    +description: null 
    +explicitlyTrashed: null 
    +fileExtension: null 
    +folderColorRgb: null 
    +fullFileExtension: null 
    +headRevisionId: null 
    +iconLink: null 
    +id: "1WoKgfNSFN1sIDqbLNahTMe4Ds8rNygt2E8AkUcbO1qM" 
    #imageMediaMetadataType: "Google_Service_Drive_DriveFileImageMediaMetadata" 
    #imageMediaMetadataDataType: "" 
    +isAppAuthorized: null 
    +kind: "drive#file" 
    #lastModifyingUserType: "Google_Service_Drive_User" 
    #lastModifyingUserDataType: "" 
    +md5Checksum: null 
    +mimeType: "application/vnd.google-apps.document" 
    +modifiedByMeTime: null 
    +modifiedTime: null 
    +name: "+ 4.4 Szkolenia żeglarskie, REJSY SZKOLENIOWE" 
    +originalFilename: null 
    +ownedByMe: null 
    #ownersType: "Google_Service_Drive_User" 
    #ownersDataType: "array" 
    +parents: null 
    #permissionsType: "Google_Service_Drive_Permission" 
    #permissionsDataType: "array" 
    +properties: null 
    +quotaBytesUsed: null 
    +shared: null 
    +sharedWithMeTime: null 
    #sharingUserType: "Google_Service_Drive_User" 
    #sharingUserDataType: "" 
    +size: null 
    +spaces: null 
    +starred: null 
    +thumbnailLink: null 
    +trashed: null 
    +version: null 
    #videoMediaMetadataType: "Google_Service_Drive_DriveFileVideoMediaMetadata" 
    #videoMediaMetadataDataType: "" 
    +viewedByMe: null 
    +viewedByMeTime: null 
    +viewersCanCopyContent: null 
    +webContentLink: null 
    +webViewLink: null 
    +writersCanShare: null 
    #internal_gapi_mappings: [] 
    #modelData: [] 
    #processed: [] 
    } 

この日付を取得する別の方法はありますか?

+0

私は[彼re](http://stackoverflow.com/questions/35435934/how-can-i-get-files-lastmodified-in-google-drive-api-v3)、ドライブAPI v3ではデフォルトでフルリソースが返されなくなりました。 [fieldsクエリパラメータ](https://developers.google.com/drive/v3/web/migration#fields)を使用して、返される特定のフィールドをリクエストします。この[関連スレッド](http://stackoverflow.com/questions/16114970/google-drive-document-time-stamp)もチェックしてください。 – abielita

答えて

0

あなたは、私はこれが

を見てみましょういくつかの有用な機能 https://github.com/sazaamout/gDrive/blob/master/gDrive.php

のための私のgitリポジトリを見てみましょう役立つことを願っています。この

$response = $this->service->files->get($fileId, array(
    'fields' => 'id, name, modifiedTime', 
    // uncomment the following if you are working with team drive 
    //'supportsTeamDrives' => true 
)); 
print_r($response); 

を試してみてください、あなたが必要とするフィールド内容を指定すべきです詳細については、次のリンクを参照してください。 https://developers.google.com/drive/v3/web/search-parameters#file_fields

関連する問題