UserPhoto
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
JSON 表示法 |
{
"id": string,
"primaryEmail": string,
"kind": string,
"etag": string,
"photoData": string,
"mimeType": string,
"width": integer,
"height": integer
} |
欄位 |
id |
string
API 用於識別使用者身分的 ID。
|
primaryEmail |
string
使用者的主要電子郵件地址。
|
kind |
string
API 資源的類型。對於相片資源,則為 admin#directory#user#photo 。
|
etag |
string
資源的 ETag。
|
photoData |
string (bytes format)
使用者相片的上傳資料,以 網頁安全 Base64 格式和位元組為單位。因此:
- 斜線 (/) 字元會替換成底線 (_) 字元。
- 加號 (+) 字元會替換成連字號 (-) 字元。
- 等號 (=) 字元會替換成星號 (*)。
- 在填充方面,我們使用的是句號 (.) 字元,而非 RFC-4648 baseURL 定義,後者會使用等號 (=) 填充。這麼做是為了簡化網址剖析作業。
- 無論上傳的照片大小為何,API 都會將其縮小至 96x96 像素。
Base64 編碼字串。
|
mimeType |
string
相片的 MIME 類型。允許的值為 JPEG 、PNG 、GIF 、BMP 、TIFF 和網頁安全 Base64 編碼。
|
width |
integer
相片的寬度 (以像素為單位)。
|
height |
integer
相片的高度 (以像素為單位)。
|
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-24 (世界標準時間)。
[null,null,["上次更新時間:2025-07-24 (世界標準時間)。"],[],[],null,["# UserPhoto\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"id\": string, \"primaryEmail\": string, \"kind\": string, \"etag\": string, \"photoData\": string, \"mimeType\": string, \"width\": integer, \"height\": integer } ``` |\n\n| Fields ||\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `id` | `string` The ID the API uses to uniquely identify the user. |\n| `primaryEmail` | `string` The user's primary email address. |\n| `kind` | `string` The type of the API resource. For Photo resources, this is `admin#directory#user#photo`. |\n| `etag` | `string` ETag of the resource. |\n| `photoData` | `string (`[bytes](https://developers.google.com/discovery/v1/type-format)` format)` The user photo's upload data in [web-safe Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: - The slash (/) character is replaced with the underscore (_) character. - The plus sign (+) character is replaced with the hyphen (-) character. - The equals sign (=) character is replaced with the asterisk (\\*). - For padding, the period (.) character is used instead of the RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to simplify URL-parsing. - Whatever the size of the photo being uploaded, the API downsizes it to 96x96 pixels. A base64-encoded string. |\n| `mimeType` | `string` The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding. |\n| `width` | `integer` Width of the photo in pixels. |\n| `height` | `integer` Height of the photo in pixels. |"]]