# Google Play MDM API . users

## Instance Methods

Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.

Retrieves a user's details.

Looks up a user by email address.

Revokes a previously generated token (activation code) for the user.

### Method Details

`generateToken(enterpriseId, userId)`

    Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

    Returns:
      An object of the form:

        { # A UserToken is used by a user when setting up a managed device or profile with their work account on a device. When the user enters their email address and token (activation code) the appropriate MDM app can be automatically downloaded.
        "kind": "androidenterprise#userToken", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#userToken".
        "userId": "A String", # The unique ID for the user.
        "token": "A String", # The token (activation code) to be entered by the user. This consists of a sequence of decimal digits. Note that the leading digit may be 0.
      }

`get(enterpriseId, userId)`

    Retrieves a user's details.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)

    Returns:
      An object of the form:

        { # A user resource represents an individual user within the enterprise's domain.
            #
            # Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing an MDM app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API.
            #
            # The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address.
          "kind": "androidenterprise#user", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user".
          "primaryEmail": "A String", # The user's primary email, e.g. "jsmith@example.com".
          "id": "A String", # The unique ID for the user.
        }

`list(enterpriseId, email)`

    Looks up a user by email address.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      email: string, The exact primary email address of the user to look up. (required)

    Returns:
      An object of the form:

        { # The matching user resources.
        "kind": "androidenterprise#usersListResponse", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#usersListResponse".
        "user": [ # A user of an enterprise.
          { # A user resource represents an individual user within the enterprise's domain.
                #
                # Note that each user is associated with a Google account based on the user's corporate email address (which must be in one of the enterprise's domains). As part of installing an MDM app to manage a device the Google account must be provisioned to the device, and so the user resource must be created before that. This can be done using the Google Admin SDK Directory API.
                #
                # The ID for a user is an opaque string. It can be retrieved using the list method queried by the user's primary email address.
              "kind": "androidenterprise#user", # Identifies what kind of resource this is. Value: the fixed string "androidenterprise#user".
              "primaryEmail": "A String", # The user's primary email, e.g. "jsmith@example.com".
              "id": "A String", # The unique ID for the user.
            },
        ],
      }

`revokeToken(enterpriseId, userId)`

    Revokes a previously generated token (activation code) for the user.

    Args:
      enterpriseId: string, The ID of the enterprise. (required)
      userId: string, The ID of the user. (required)