The photos space will sunset in early January 2018. Your users can continue to access Google Photos via the drive space by enabling the Google Photos folder in My Drive in the Drive client settings

Changes: get

Requires authorization

Gets a specific change. Try it now or see an example.


HTTP request



Parameter name Value Description
Path parameters
changeId string The ID of the change.
Optional query parameters
supportsTeamDrives boolean Whether the requesting application supports Team Drives. (Default: false)
teamDriveId string The Team Drive from which the change will be returned.


This request requires authorization with at least one of the following scopes (read more about authentication and authorization).


Request body

Do not supply a request body with this method.


If successful, this method returns a Changes resource in the response body.


Note: The code examples available for this method do not represent all supported programming languages (see the client libraries page for a list of supported languages).


Uses the Java client library.


// ...

public class MyClass {

  // ...

   * Print a single Change resource information.
   * @param service Drive API service instance.
   * @param changeId ID of the Change resource to retrieve.
  private static void printChange(Drive service, String changeId) {
    try {
      Change change = service.changes().get(changeId).execute();

      System.out.println("Changed file ID: " + change.getFileId());
      if (change.getDeleted()) {
        System.out.println("File has been deleted");
      } else {
        File changedFile = change.getFile();
        System.out.println("Changed file Title: " + changedFile.getTitle());
    } catch (IOException e) {
      System.out.println("An error occurred: " + e);

  // ...


Uses the .NET client library.

using Google.Apis.Drive.v2;
using Google.Apis.Drive.v2.Data;

using System.Net;
// ...

public class MyClass {

  // ...

  /// <summary>
  /// Print a single Change resource information.
  /// </summary>
  /// <param name="service">Drive API service instance.</param>
  /// <param name="changeId">ID of the Change resource to retrieve.</param>
  public static void PrintChange(DriveService service, String changeId) {
    try {
      Change change = service.Changes.Get(changeId).Execute();

      Console.WriteLine("Changed file ID: " + change.FileId);
      if (change.Deleted.HasValue && (bool)change.Deleted) {
        Console.WriteLine("File has been deleted");
      } else {
        File changedFile = change.File;
        Console.WriteLine("Changed file Title: " + changedFile.Title);
    } catch (Exception e) {
      Console.WriteLine("An error occurred: " + e.Message);

  // ...


Uses the PHP client library.

 * Print a single Change resource information.
 * @param Google_Service_Drive $service Drive API service instance.
 * @param String $changeId ID of the Change resource to retrieve.
function printChange($service, $changeId) {
  try {
    $change = $service->changes->get($changeId);

    print "Changed file ID: " . $change->getFileId();
    if ($change->getDeleted()) {
      print "File has been deleted";
    } else {
      $changedFile = $change->getFile();
      print "Changed file Title: " . $changedFile->getTitle();
  } catch (Exception $e) {
    print "An error occurred: " . $e->getMessage();


Uses the Python client library.

from apiclient import errors
# ...

def print_change(service, change_id):
  """Print a single Change resource information.

    service: Drive API service instance.
    change_id: ID of the Change resource to retrieve.
    change = service.changes().get(changeId=change_id).execute()

    print 'Changed file ID: %s' % change['fileId']
    if change['deleted']:
      print 'File has been deleted'
      file = change['file']
      print 'Changed file Title: %s' % file['title']
  except errors.HttpError, error:
    print 'An error occurred: %s' % error


Uses the JavaScript client library.

 * Print a single Change resource information.
 * @param {String} changeId ID of the Change resource to retrieve.
function printChange(changeId) {
  var request ={
    'changeId': changeId
  request.execute(function(resp) {
    if (resp.deleted) {
      console.log('File has been deleted');
    } else {
      var file = resp.file;
      console.log('Changed file Title: ' + file.title);


Uses the Go client library.

import (

// PrintChange fetches and displays the change with the passed changeId
func PrintChange(d *drive.Service, changeId string) error {
  c, err := d.Changes.Get(changeId).Do()
  if err != nil {
    fmt.Printf("An error occurred: %v\n", err)
    return err
  fmt.Printf("Changed file ID: %v\n", c.FileId)
  if c.Deleted {
    fmt.Printf("File has been deleted\n")
  } else {
    fmt.Printf("Changed file Title: %v\n",  c.File.Title)
  return nil


Uses the Objective-C client library.

#import "GTLDrive.h"
// ...

+ (void)printChangeWithService:(GTLServiceDrive *)service
                      changeId:(NSString *)changeId {
  GTLQueryDrive *query = [GTLQueryDrive queryForChangesGetWithChangeId:changeId];
  // queryTicket can be used to track the status of the request.
  GTLServiceTicket *queryTicket =
    [service executeQuery:query
        completionHandler:^(GTLServiceTicket *ticket, GTLDriveChange *change,
                            NSError *error) {
          if (error == nil) {
            NSLog(@"Current user name: %@", change.fileId);

            if ([change.deleted boolValue]) {
              NSLog(@"File has been deleted");
            } else {
              GTLDriveFile *changedFile = change.file;
              NSLog(@"Changed file Title: %@", changedFile.title);
          } else {
            NSLog(@"An error occurred: %@", error);

// ...

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Send feedback about...

Drive REST API v2
Drive REST API v2