register_device

CognitoSync.Client.register_device(**kwargs)

Registers a device to receive push sync notifications.

This API can only be called with temporary credentials provided by Cognito Identity. You cannot call this API with developer credentials.

See also: AWS API Documentation

Request Syntax

response = client.register_device(
    IdentityPoolId='string',
    IdentityId='string',
    Platform='APNS'|'APNS_SANDBOX'|'GCM'|'ADM',
    Token='string'
)
Parameters
  • IdentityPoolId (string) --

    [REQUIRED]

    A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. Here, the ID of the pool that the identity belongs to.

  • IdentityId (string) --

    [REQUIRED]

    The unique ID for this identity.

  • Platform (string) --

    [REQUIRED]

    The SNS platform type (e.g. GCM, SDM, APNS, APNS_SANDBOX).

  • Token (string) --

    [REQUIRED]

    The push token.

Return type

dict

Returns

Response Syntax

{
    'DeviceId': 'string'
}

Response Structure

  • (dict) --

    Response to a RegisterDevice request.

    • DeviceId (string) --

      The unique ID generated for this device by Cognito.

Exceptions

  • CognitoSync.Client.exceptions.NotAuthorizedException
  • CognitoSync.Client.exceptions.InvalidParameterException
  • CognitoSync.Client.exceptions.ResourceNotFoundException
  • CognitoSync.Client.exceptions.InternalErrorException
  • CognitoSync.Client.exceptions.InvalidConfigurationException
  • CognitoSync.Client.exceptions.TooManyRequestsException