photos
Creates, updates, deletes, gets or lists a photos
resource.
Overview
Name | photos |
Type | Resource |
Id | googleadmin.directory.photos |
Fields
The following fields are returned by SELECT
queries:
- get
Successful response
Name | Datatype | Description |
---|---|---|
id | string | The ID the API uses to uniquely identify the user. |
etag | string | ETag of the resource. |
height | integer (int32) | Height of the photo in pixels. |
kind | string | The type of the API resource. For Photo resources, this is admin#directory#user#photo . (default: admin#directory#user#photo) |
mimeType | string | The MIME type of the photo. Allowed values are JPEG , PNG , GIF , BMP , TIFF , and web-safe base64 encoding. |
photoData | string (byte) | The user photo's upload data in web-safe Base64 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. |
primaryEmail | string | The user's primary email address. |
width | integer (int32) | Width of the photo in pixels. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | userKey | Retrieves the user's photo. | |
patch | update | userKey | Adds a photo for the user. This method supports patch semantics. | |
update | replace | userKey | Adds a photo for the user. | |
delete | delete | userKey | Removes the user's photo. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
userKey | string |
SELECT
examples
- get
Retrieves the user's photo.
SELECT
id,
etag,
height,
kind,
mimeType,
photoData,
primaryEmail,
width
FROM googleadmin.directory.photos
WHERE userKey = '{{ userKey }}' -- required;
UPDATE
examples
- patch
Adds a photo for the user. This method supports patch semantics.
UPDATE googleadmin.directory.photos
SET
data__id = '{{ id }}',
data__primaryEmail = '{{ primaryEmail }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__photoData = '{{ photoData }}',
data__mimeType = '{{ mimeType }}',
data__width = {{ width }},
data__height = {{ height }}
WHERE
userKey = '{{ userKey }}' --required
RETURNING
id,
etag,
height,
kind,
mimeType,
photoData,
primaryEmail,
width;
REPLACE
examples
- update
Adds a photo for the user.
REPLACE googleadmin.directory.photos
SET
data__id = '{{ id }}',
data__primaryEmail = '{{ primaryEmail }}',
data__kind = '{{ kind }}',
data__etag = '{{ etag }}',
data__photoData = '{{ photoData }}',
data__mimeType = '{{ mimeType }}',
data__width = {{ width }},
data__height = {{ height }}
WHERE
userKey = '{{ userKey }}' --required
RETURNING
id,
etag,
height,
kind,
mimeType,
photoData,
primaryEmail,
width;
DELETE
examples
- delete
Removes the user's photo.
DELETE FROM googleadmin.directory.photos
WHERE userKey = '{{ userKey }}' --required;