Admin SDK API . users . photos

Instance Methods

close()

Close httplib2 connections.

delete(userKey, x__xgafv=None)

Removes the user's photo.

get(userKey, x__xgafv=None)

Retrieves the user's photo.

patch(userKey, body=None, x__xgafv=None)

Adds a photo for the user. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).

update(userKey, body=None, x__xgafv=None)

Adds a photo for the user.

Method Details

close()
Close httplib2 connections.
delete(userKey, x__xgafv=None)
Removes the user's photo.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format
get(userKey, x__xgafv=None)
Retrieves the user's photo.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "etag": "A String", # ETag of the resource.
  "height": 42, # Height of the photo in pixels.
  "id": "A String", # The ID the API uses to uniquely identify the user.
  "kind": "admin#directory#user#photo", # The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
  "mimeType": "A String", # The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding.
  "photoData": "A String", # 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.
  "primaryEmail": "A String", # The user's primary email address.
  "width": 42, # Width of the photo in pixels.
}
patch(userKey, body=None, x__xgafv=None)
Adds a photo for the user. This method supports [patch semantics](/admin-sdk/directory/v1/guides/performance#patch).

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  body: object, The request body.
    The object takes the form of:

{
  "etag": "A String", # ETag of the resource.
  "height": 42, # Height of the photo in pixels.
  "id": "A String", # The ID the API uses to uniquely identify the user.
  "kind": "admin#directory#user#photo", # The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
  "mimeType": "A String", # The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding.
  "photoData": "A String", # 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.
  "primaryEmail": "A String", # The user's primary email address.
  "width": 42, # Width of the photo in pixels.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "etag": "A String", # ETag of the resource.
  "height": 42, # Height of the photo in pixels.
  "id": "A String", # The ID the API uses to uniquely identify the user.
  "kind": "admin#directory#user#photo", # The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
  "mimeType": "A String", # The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding.
  "photoData": "A String", # 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.
  "primaryEmail": "A String", # The user's primary email address.
  "width": 42, # Width of the photo in pixels.
}
update(userKey, body=None, x__xgafv=None)
Adds a photo for the user.

Args:
  userKey: string, Identifies the user in the API request. The value can be the user's primary email address, alias email address, or unique user ID. (required)
  body: object, The request body.
    The object takes the form of:

{
  "etag": "A String", # ETag of the resource.
  "height": 42, # Height of the photo in pixels.
  "id": "A String", # The ID the API uses to uniquely identify the user.
  "kind": "admin#directory#user#photo", # The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
  "mimeType": "A String", # The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding.
  "photoData": "A String", # 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.
  "primaryEmail": "A String", # The user's primary email address.
  "width": 42, # Width of the photo in pixels.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  "etag": "A String", # ETag of the resource.
  "height": 42, # Height of the photo in pixels.
  "id": "A String", # The ID the API uses to uniquely identify the user.
  "kind": "admin#directory#user#photo", # The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
  "mimeType": "A String", # The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-safe base64 encoding.
  "photoData": "A String", # 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.
  "primaryEmail": "A String", # The user's primary email address.
  "width": 42, # Width of the photo in pixels.
}