api - Java get metadata of public file on Google Drive -
hello i've downloaded , installed latest version of drive rest api java , want metadata of public file google drive fileid - have following code:
private static final string application_name = "test"; private static final string file_id = "thefileid"; public static void main(string[] args) { httptransport httptransport = new nethttptransport(); jacksonfactory jsonfactory = new jacksonfactory(); drive service = new drive.builder(httptransport, jsonfactory, null).setapplicationname(application_name).build(); printfile(service, file_id); } private static void printfile(drive service, string fileid) { try { file file = service.files().get(fileid).execute(); system.out.println("title: " + file.gettitle()); } catch (ioexception e) { system.out.println("an error occured: " + e); } }
but error message: "daily limit unauthenticated use exceeded. continued use requires signup."
i've tried on https://developers.google.com/drive/v2/reference/files/get worked out fine.
do have authenticate api key when file public , how if so.
thanks time.
yes, need authenticate api key. see documentation here: https://developers.google.com/drive/web/about-auth
Comments
Post a Comment