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 资源的类型。对于 Google 相册资源,此值为 admin#directory#user#photo 。
|
etag |
string
资源的 ETag。
|
photoData |
string (bytes format)
用户照片的上传数据(以字节为单位),采用网络安全 Base64 格式。这意味着:
- 斜杠 (/) 字符会替换为下划线 (_) 字符。
- 加号 (+) 字符会被连字符 (-) 字符替换。
- 等号 (=) 字符会被替换为星号 (*)。
- 在填充时,使用英文句点 (.) 字符,而不是 RFC-4648 base网址 定义(使用等号 (=) 进行填充)。这样做是为了简化网址解析。
- 无论上传的照片大小如何,该 API 都会将其缩小到 96 x 96 像素。
使用 base64 编码的字符串。
|
mimeType |
string
照片的 MIME 类型。允许的值包括 JPEG 、PNG 、GIF 、BMP 、TIFF 和适用于网络的 base64 编码。
|
width |
integer
照片的宽度(以像素为单位)。
|
height |
integer
照片的高度(以像素为单位)。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-24。
[null,null,["最后更新时间 (UTC):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. |"]]