Mengambil foto untuk kontak bersama
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Untuk mendapatkan foto kontak, kirim permintaan GET
HTTP ke
link foto kontak:
GET https://google.com/m8/feeds/photos/media/DOMAIN/PHOTO_LINK
Ganti kode berikut:
DOMAIN
: URL untuk domain Anda—misalnya,
example.com.
PHOTO_LINK
: Nilai numerik unik yang
mewakili link foto untuk kontak yang dibagikan—misalnya, c9012de.
Server menampilkan kode status HTTP 200 OK
dan foto. Jika
kontak tidak memiliki foto, elemen link foto tidak akan memiliki
atribut gd:etag
. Elemen gd:etag
memungkinkan Anda merujuk ke versi
foto tertentu.
Misalnya, untuk mendapatkan versi terbaru foto untuk kontak dengan elemen berikut:
<link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*"
href="https://google.com/m8/feeds/photos/media/example.com/c9012de"/>
Kirim permintaan HTTP berikut:
GET https://google.com/m8/feeds/photos/media/example.com/c9012de
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-03-25 UTC.
[null,null,["Terakhir diperbarui pada 2025-03-25 UTC."],[],[],null,["# Get a photo for a shared contact\n\n- To get a photo for a contact, send an HTTP `GET` request to the\n photo link of the contact:\n\n ```xml\n GET https://google.com/m8/feeds/photos/media/DOMAIN/PHOTO_LINK\n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eDOMAIN\u003c/var\u003e: The URL for your domain---for example, example.com.\n - \u003cvar translate=\"no\"\u003ePHOTO_LINK\u003c/var\u003e: A unique numerical value that represents the photo link for the shared contact---for example, c9012de.\n\n The server returns an HTTP `200 OK` status code and the photo. If a\n contact doesn't have a photo, then the photo link element doesn't have a\n `gd:etag` attribute. The `gd:etag` element lets you refer to a specific\n version of a photo.\n\nFor example, to get the latest version of a photo for a contact with the\nfollowing element: \n\n```xml\n\u003clink rel=\"http://schemas.google.com/contacts/2008/rel#photo\" type=\"image/*\"\n href=\"https://google.com/m8/feeds/photos/media/example.com/c9012de\"/\u003e\n```\n\nSend the following HTTP request: \n\n```xml\nGET https://google.com/m8/feeds/photos/media/example.com/c9012de\n```"]]