CognitoIdentityProvider / Client / admin_get_device

admin_get_device#

CognitoIdentityProvider.Client.admin_get_device(**kwargs)#

Given the device key, returns details for a user’ device. For more information, see Working with devices.

Note

Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.

Learn more

See also: AWS API Documentation

Request Syntax

response = client.admin_get_device(
    DeviceKey='string',
    UserPoolId='string',
    Username='string'
)
Parameters:
  • DeviceKey (string) –

    [REQUIRED]

    The key of the device that you want to delete. You can get device IDs in the response to an AdminListDevices request.

  • UserPoolId (string) –

    [REQUIRED]

    The ID of the user pool where the device owner is a user.

  • Username (string) –

    [REQUIRED]

    The username of the user that you want to query or modify. The value of this parameter is typically your user’s username, but it can be any of their alias attributes. If username isn’t an alias attribute in your user pool, this value must be the sub of a local user or the username of a user from a third-party IdP.

Return type:

dict

Returns:

Response Syntax

{
    'Device': {
        'DeviceKey': 'string',
        'DeviceAttributes': [
            {
                'Name': 'string',
                'Value': 'string'
            },
        ],
        'DeviceCreateDate': datetime(2015, 1, 1),
        'DeviceLastModifiedDate': datetime(2015, 1, 1),
        'DeviceLastAuthenticatedDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) –

    Gets the device response, as an administrator.

    • Device (dict) –

      Details of the requested device. Includes device information, last-accessed and created dates, and the device key.

      • DeviceKey (string) –

        The device key, for example us-west-2_EXAMPLE-a1b2c3d4-5678-90ab-cdef-EXAMPLE22222.

      • DeviceAttributes (list) –

        Metadata about a user’s device, like name and last-access source IP.

        • (dict) –

          The name and value of a user attribute.

          This data type is a request parameter of AdminUpdateUserAttributes and UpdateUserAttributes.

          • Name (string) –

            The name of the attribute.

          • Value (string) –

            The value of the attribute.

      • DeviceCreateDate (datetime) –

        The date and time when the item was created. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • DeviceLastModifiedDate (datetime) –

        The date and time when the item was modified. Amazon Cognito returns this timestamp in UNIX epoch time format. Your SDK might render the output in a human-readable format like ISO 8601 or a Java Date object.

      • DeviceLastAuthenticatedDate (datetime) –

        The date when the user last signed in with the device.

Exceptions

  • CognitoIdentityProvider.Client.exceptions.ResourceNotFoundException

  • CognitoIdentityProvider.Client.exceptions.InvalidParameterException

  • CognitoIdentityProvider.Client.exceptions.InvalidUserPoolConfigurationException

  • CognitoIdentityProvider.Client.exceptions.TooManyRequestsException

  • CognitoIdentityProvider.Client.exceptions.InternalErrorException

  • CognitoIdentityProvider.Client.exceptions.NotAuthorizedException