Contacts: delete

승인 필요

연락처를 삭제합니다. 예를 참조하세요.

요청

HTTP 요청

DELETE https://www.googleapis.com/mirror/v1/contacts/id

매개변수

매개변수 이름 설명
경로 매개변수
id string 연락처의 ID입니다.

확인할 내용

이 요청을 처리하려면 다음 범위의 승인을 받아야 합니다(인증 및 승인 자세히 알아보기).

범위
https://www.googleapis.com/auth/glass.timeline

요청 본문

이 메소드를 사용할 때는 요청 본문을 제공하지 마세요.

응답

요청에 성공한 경우 이 메소드는 빈 응답 본문을 반환합니다.

참고: 이 메서드에 제공되는 코드 예시가 지원되는 모든 프로그래밍 언어를 나타내는 것은 아닙니다. 지원되는 언어 목록은 클라이언트 라이브러리 페이지를 참조하세요.

자바

자바 클라이언트 라이브러리를 사용합니다.

import com.google.api.services.mirror.Mirror;
import com.google.api.services.mirror.model.Contact;

import java.io.IOException;

public class MyClass {
  // ...

  /**
   * Delete a contact for the current user.
   * 
   * @param service Authorized Mirror service.
   * @param contactId ID of the Contact to delete.
   */
  public static void deleteContact(Mirror service, String contactId) {
    try {
      service.contacts().delete(contactId).execute();
    } catch (IOException e) {
      System.err.println("An error occurred: " + e);
    }
  }

  // ...
}

.NET

.NET 클라이언트 라이브러리를 사용합니다.

using System;

using Google.Apis.Mirror.v1;

public class MyClass {
  // ...

  /// <summary>
  /// Delete a contact for the current user.
  /// </summary>
  /// <param name='service'>Authorized Mirror service.</param>
  /// <param name='contactId'>ID of the Contact to delete.</param>
  public static void DeleteContact(MirrorService service,
      String contactId) {
    try {
      service.Contacts.Delete(contactId).Fetch();
    } catch (Exception e) {
      Console.WriteLine("An error occurred: " + e.Message);
    }
  }

  // ...
}

PHP

PHP 클라이언트 라이브러리를 사용합니다.

/**
 * Delete a contact for the current user.
 *
 * @param Google_MirrorService $service Authorized Mirror service.
 * @param string $contactId ID of the Contact to delete.
 */
function deleteContact($service, $contactId) {
  try {
    $service->contacts->delete($contactId);
  } catch (Exception $e) {
    print 'An error occurred: ' . $e->getMessage();
  }
}

Python

Python 클라이언트 라이브러리를 사용합니다.

from apiclient import errors
# ...

def delete_contact(service, contact_id):
  """Delete a contact for the current user.

  Args:
    service: Authorized Mirror service.
    contact_id: ID of the Contact to delete.
  """
  try:
    service.contacts().delete(contact_id).execute()
  except errors.HttpError, error:
    print 'An error occurred: %s' % error

Ruby

Ruby 클라이언트 라이브러리를 사용합니다.

##
# Delete a contact for the current user.
#
# @param [Google::APIClient] client
#   Authorized client instance.
# @param [String] contact_id
#   ID of the contact to delete.
# @return nil
def delete_contact(client, contact_id)
  mirror = client.discovered_api('mirror', 'v1')
  result = client.execute(
    :api_method => mirror.contacts.delete,
    :parameters => { 'id' => contact_id })
  if result.error?
    puts "An error occurred: #{result.data['error']['message']}"
  end
end

Go

Go 클라이언트 라이브러리 사용

import (
        "code.google.com/p/google-api-go-client/mirror/v1"
        "fmt"
)

// DeleteContact deletes a contact for the current user.
func DeleteContact(g *mirror.Service, contactId string) error {
        err := g.Contacts.Delete(contactId).Do()
        if err != nil {
                fmt.Printf("An error occurred: %v\n", err)
        }
        return err
}

원시 HTTP

클라이언트 라이브러리를 사용하지 않습니다.

DELETE /mirror/v1/contacts/harold HTTP/1.1
Authorization: Bearer auth token