Get File Information

Guides Files Get File Information
Edit this page

Get File Information

To get a file's information, not it's content, call the GET /files/:id API with the id of the file.

curl -i -X GET "" \
     -H "Authorization: Bearer <ACCESS_TOKEN>"
BoxFile file = new BoxFile(api, "id");
BoxFile.Info info = file.getInfo();
file_id = '11111'
file_info = client.file(file_id).get()
print('File "{0}" has a size of {1} bytes'.format(, file_info.size))
client.files.get(fileId: "11111", fields: ["name", "created_at"]) { (result: Result<File, BoxSDKError>) in
    guard case let .success(file) = result else {
        print("Error retrieving file information")

    print("File \( was created at \(file.createdAt)")

File ID

The id for any file can be determined by visiting a file in the web application and copying the id from the URL. For example, for the URL https://* the file_id is 123.

Additional fields

To get more of the fields for a file, make sure to pass along the fields query parameter.

Learn about requesting extra fields