공유 연락처 가져오기

다음과 같은 방법으로 공유 사용자 연락처를 요청합니다.

  • 모든 공유 연락처
  • 지정된 기준과 일치하는 연락처 집합
  • 단일 공유 연락처
  • 연락처의 사진

기본적으로 피드의 항목은 정렬되지 않습니다.

모든 공유 연락처 가져오기

  1. 모든 공유 연락처를 가져오려면 연락처 피드 URL에 HTTP GET 요청을 보냅니다.

    GET https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION

    다음을 바꿉니다.

    • DOMAIN: 도메인 예: example.com
    • PROJECTION: 투영 값입니다. 지원되는 값은 투영 값을 참고하세요.

    서버는 HTTP 200 OK 상태 코드와 Atom 1.0 피드를 반환합니다. 다음 예는 항목이 하나인 연락처 피드를 보여줍니다.

    <feed xmlns='http://www.w3.org/2005/Atom'
        xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
        xmlns:gd='http://schemas.google.com/g/2005'
        xmlns:gContact='http://schemas.google.com/contact/2008'
        xmlns:batch='http://schemas.google.com/gdata/batch'>
      <id>https://www.google.com/m8/feeds/contacts/example.com/base</id>
      <updated>2008-03-05T12:36:38.836Z</updated>
      <category scheme='http://schemas.google.com/g/2005#kind'
        term='http://schemas.google.com/contact/2008#contact' />
      <title type='text'>example.com's Contacts</title>
      <link rel='http://schemas.google.com/g/2005#feed'
        type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full' />
      <link rel='http://schemas.google.com/g/2005#post'
        type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full' />
      <link rel='http://schemas.google.com/g/2005#batch'
        type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full/batch' />
      <link rel='self' type='application/atom+xml'
        href='https://www.google.com/m8/feeds/contacts/example.com/full?max-results=25' />
      <author>
        <name>example.com</name>
        <email>example.com</email>
      </author>
      <generator version='1.0' uri='https://www.google.com/m8/feeds/contacts'>
        Contacts
      </generator>
      <openSearch:totalResults>1</openSearch:totalResults>
      <openSearch:startIndex>1</openSearch:startIndex>
      <openSearch:itemsPerPage>25</openSearch:itemsPerPage>
      <entry>
        <id>
          https://www.google.com/m8/feeds/contacts/example.com/base/c9012de
        </id>
        <updated>2008-03-05T12:36:38.835Z</updated>
        <category scheme='http://schemas.google.com/g/2005#kind'
          term='http://schemas.google.com/contact/2008#contact' />
        <title type='text'>Fitzgerald</title>
        <gd:name>
          <gd:fullName>Fitzgerald</gd:fullName>
        </gd:name>
        <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*"
          href="http://google.com/m8/feeds/photos/media/example.com/c9012de"/>
        <link rel='self' type='application/atom+xml'
          href='https://www.google.com/m8/feeds/contacts/example.com/full/c9012de' />
        <link rel='edit' type='application/atom+xml'
          href='https://www.google.com/m8/feeds/contacts/example.com/full/c9012de/1204720598835000' />
        <gd:phoneNumber rel='http://schemas.google.com/g/2005#home'
          primary='true'>
          456
        </gd:phoneNumber>
        <gd:extendedProperty name="pet" value="hamster" />
      </entry>
    </feed>
  2. 피드는 단일 응답에서 최대 10MB를 반환합니다. 전체 목록을 가져오려면 반환된 피드에서 다음 링크를 반복해서 클릭하세요.

쿼리 매개변수를 사용하여 공유 연락처 가져오기

특정 날짜 이후에 업데이트된 연락처와 같이 지정된 기준과 일치하는 연락처를 요청합니다. 전체 텍스트 쿼리 및 이메일 주소 조회는 지원되지 않습니다. 모든 쿼리 매개변수는 Domain Shared Contacts API 참조 가이드를 참고하세요.

  1. 다음과 같은 매개변수를 사용하여 연락처 피드 URL에 HTTP GET 요청을 보냅니다.

    GET https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION?PARAMETER

    다음을 바꿉니다.

    예를 들어 example.com의 항목을 2022년 3월 16일 이후에 업데이트하려면 updated-min 매개변수를 추가합니다.

    GET https://www.google.com/m8/feeds/contacts/example.com/full?updated-min=2022-03-16T00:00:00
    

    서버는 HTTP 200 OK 상태 코드와 일치하는 항목이 포함된 피드를 반환합니다.

  2. 피드는 단일 응답에서 최대 10MB를 반환합니다. 전체 목록을 가져오려면 반환된 피드에서 다음 링크를 반복해서 따릅니다.

증분 변경사항 추적

도메인 공유 연락처 목록의 변경사항을 추적하려면 다음 단계를 따르세요. 1. 피드의 <updated> 요소 값을 기록합니다. 1. updated-min을 해당 <updated> 값으로 설정하고 showdeletedtrue로 설정하여 변경된 연락처를 요청합니다.

단일 공유 연락처 가져오기

특정 연락처를 가져오려면 공유 연락처 피드에서 찾을 수 있는 연락처의 자체 링크를 사용하세요. 자세한 내용은 모든 공유 연락처 가져오기를 참고하세요.

  1. 특정 연락처를 가져오려면 연락처의 자체 링크에 HTTP GET 요청을 전송합니다.
    GET https://www.google.com/m8/feeds/contacts/DOMAIN/PROJECTION/SELF_LINK
    다음을 바꿉니다.
  • DOMAIN: 도메인(예: example.com)
  • PROJECTION: 투영 값입니다. 지원되는 값은 투영 값을 참고하세요.
  • SELF_LINK: 연락처의 고유한 숫자 값입니다.

서버는 HTTP 200 OK 상태 코드와 연락처 항목을 반환합니다.

예를 들어 자체 링크 https://www.google.com/m8/feeds/contacts/example.com/full/12345가 있는 연락처를 가져오려면 다음을 실행합니다.

GET https://www.google.com/m8/feeds/contacts/example.com/full/12345

다음 단계