I am looking to use the Box.com API to download a file. Their API documentation shows that a file_id is required to call the API endpoint. However, I cannot find how to obtain the file_id. How do you obtain the file_id if all you have is the file name?
Along the same lines what if the file is located in a specific directory within the Box.com user's account. Can you obtain the file_id from a given path?
You can find a Box file id by searching for the file by name using the Box API Search endpoint.
Related
In the latest Google Drive API update, they want us to provide them with a resourceKey, when we want to access the Google Drive shared link. They said they put the resource key in the metadata of the files, but when I get the metadata of the files, there is no resourceKey attribute in there. So, do you guys know how to get the resourceKey of the file?
Metadata request code :
$fileID = substr($url,strpos($url,'=')+1,33);
$metadata=\Illuminate\Support\Facades\Storage::disk("google")->getMetaData($fileID);
I am attempting to verify that I have successfully copied a bunch of photos from google photos to onedrive. I can programmatically get the sha1 hash of each file stored in OneDrive but I don't see the same option from the google photos rest api. I would have expected it to be in the metadata: https://developers.google.com/photos/library/reference/rest/v1/mediaItems#MediaMetadata
It also doesn't look like the stored photos are exposed through the Google Drive api, so how do I get the hash?
You can get the MD5 Checksum for the files stored on Google drive with the Drive API.
However, there is no way to get the SHA1 hash for files without downloading them.
Also, there is no way to get either of those with the Google Photos API.
Yes you can without downloading the photos - check rclone (listing as jsons returns the hashes)
https://rclone.org/commands/rclone_lsjson/
https://rclone.org/googlephotos/
In the V2 API, is there a convenient way to upload a new copy of an existing file so that it is given a unique filename (e.g., by appending "(copy_number)" to the original filename)?
I am currently using the https://upload.box.net/api/1.0/new_copy URL from the V1 API to achieve this. Is there an equivalent way to accomplish this using the V2 API?
The Copy a File API method will do exactly this. You can specify a new name and/or parent folder.
When I get a file's metadata using Google drive REST API, there is no field like embedLink in file's resource. While in documentation of file resource it is mentioned that this field is meant for embeddable link. How do I get this field in my file's resource?
Thanks in advance.
Only files with known mime types contain an embedLink such as Docs files and files that can be previewed with Drive's Preview app.
Following the Hello world application and using the File Picker, I am able to get a google drive file information.
I would like to get the download url of this file (it is a binary file) in a my web application.
Is there any way to get it with the new javascript sdk?
Yes.
The Picker returns the id string. Use this to get the item object (https://developers.google.com/drive/v2/reference/files/get) which will contain a variety of download URL's depending on your precise requirement.