CognitoIdentityProvider / Client / get_device
get_device#
- CognitoIdentityProvider.Client.get_device(**kwargs)#
Gets the device. For more information about device authentication, see Working with user devices in your user pool.
Authorize this action with a signed-in user’s access token. It must include the scope
aws.cognito.signin.user.admin
.Note
Amazon Cognito doesn’t evaluate Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you can’t use IAM credentials to authorize requests, and you can’t grant IAM permissions in policies. For more information about authorization models in Amazon Cognito, see Using the Amazon Cognito user pools API and user pool endpoints.
See also: AWS API Documentation
Request Syntax
response = client.get_device( DeviceKey='string', AccessToken='string' )
- Parameters:
DeviceKey (string) –
[REQUIRED]
The device key.
AccessToken (string) – A valid access token that Amazon Cognito issued to the user whose device information you want to request.
- 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.
Device (dict) –
The device.
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.NotAuthorizedException
CognitoIdentityProvider.Client.exceptions.TooManyRequestsException
CognitoIdentityProvider.Client.exceptions.PasswordResetRequiredException
CognitoIdentityProvider.Client.exceptions.UserNotFoundException
CognitoIdentityProvider.Client.exceptions.UserNotConfirmedException
CognitoIdentityProvider.Client.exceptions.InternalErrorException
CognitoIdentityProvider.Client.exceptions.ForbiddenException