Replies: delete

Stay organized with collections Save and categorize content based on your preferences.

Deletes a reply. Try it now or see an example.

Request

HTTP request

DELETE https://www.googleapis.com/drive/v2/files/fileId/comments/commentId/replies/replyId

Parameters

Parameter name Value Description
Path parameters
commentId string The ID of the comment.
fileId string The ID of the file.
replyId string The ID of the reply.

Authorization

This request allows authorization with at least one of the following scopes:

Scope
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file

Some scopes are restricted and require a security assessment for your app to use them. For more information, see the authentication and authorization page.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns an empty response body.

Examples

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).

Java

Uses the Java client library.

import com.google.api.services.drive.Drive;

import java.io.IOException;
// ...

public class MyClass {

  // ...

  /**
   * Remove a reply.
   *
   * @param service Drive API service instance.
   * @param fileId ID of the file to remove the reply for.
   * @param commentId ID of the comment to remove the reply for.
   * @param replyId ID of the reply to remove.
   */
  private static void removeReply(Drive service, String fileId,
      String commentId, String replyId) {
    try {
      service.replies().delete(fileId, commentId, replyId).execute();
    } catch (IOException e) {
      System.out.println("An error occurred: " + e);
    }
  }

  // ...

}

.NET

Uses the .NET client library.

##
# Remove a reply
#
# @param [Google::APIClient] client
#   Authorized client instance
# @param [String] file_id
#   ID of the file to remove the reply for
# @param [String] comment_id
#   ID of the comment to remove the reply for
# @param [String] reply_id
#   ID of the reply to remove
# @return nil
def remove_reply(client, file_id, comment_id, reply_id)
  result = client.execute(
    :api_method => @drive.replies.delete,
    :parameters => {
      'fileId' => file_id,
      'commentId' => comment_id,
      'replyId' => reply_id
    })
  if result.status != 200
    puts "An error occurred: #{result.data['error']['message']}"
  end
end

PHP

Uses the PHP client library.

/**
 * Remove a reply.
 *
 * @param Google_Service_Drive $service Drive API service instance.
 * @param String $fileId ID of the file to remove the reply for.
 * @param String $commentId ID of the comment to remove the reply for.
 * @param String $replyId ID of the reply to remove.
 */
function removeReply($service, $fileId, $commentId, $replyId) {
  try {
    $service->replies->delete($fileId, $commentId, $replyId);
  } catch (Exception $e) {
    print "An error occurred: " . $e->getMessage();
  }
}

Python

Uses the Python client library.

from apiclient import errors
# ...

def remove_reply(service, file_id, comment_id, reply_id):
  """Remove a reply.

  Args:
    service: Drive API service instance.
    file_id: ID of the file to remove the reply for.
    comment_id: ID of the comment to remove the reply for.
    reply_id: ID of the reply to remove.
  """
  try:
    service.replies().delete(
        fileId=file_id, commentId=comment_id,
        replyId=reply_id).execute()
  except errors.HttpError, error:
    print 'An error occurred: %s' % error

JavaScript

Uses the JavaScript client library.

/**
 * Remove a reply.
 *
 * @param {String} fileId ID of the file to remove the reply for.
 * @param {String} commentId ID of the comment to remove the reply for.
 * @param {String} replyId ID of the reply to remove.
 */
function removeReply(fileId, commentId, replyId) {
  var request = gapi.client.drive.replies.delete({
    'fileId': fileId,
    'commentId': commentId,
    'replyId': replyId
  });
  request.execute(function(resp) { });
}

Try it!

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