CognitoSync / Client / list_records

list_records#

CognitoSync.Client.list_records(**kwargs)#

Gets paginated records, optionally changed after a particular sync count for a dataset and identity. With Amazon Cognito Sync, each identity has access only to its own data. Thus, the credentials used to make this API call need to have access to the identity data.

ListRecords can be called with temporary user credentials provided by Cognito Identity or with developer credentials. You should use Cognito Identity credentials to make this API call.

See also: AWS API Documentation

Request Syntax

response = client.list_records(
    IdentityPoolId='string',
    IdentityId='string',
    DatasetName='string',
    LastSyncCount=123,
    NextToken='string',
    MaxResults=123,
    SyncSessionToken='string'
)
Parameters:
  • IdentityPoolId (string) – [REQUIRED] A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

  • IdentityId (string) – [REQUIRED] A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. GUID generation is unique within a region.

  • DatasetName (string) – [REQUIRED] A string of up to 128 characters. Allowed characters are a-z, A-Z, 0-9, ‘_’ (underscore), ‘-’ (dash), and ‘.’ (dot).

  • LastSyncCount (integer) – The last server sync count for this record.

  • NextToken (string) – A pagination token for obtaining the next page of results.

  • MaxResults (integer) – The maximum number of results to be returned.

  • SyncSessionToken (string) – A token containing a session ID, identity ID, and expiration.

Return type:

dict

Returns:

Response Syntax

{
    'Records': [
        {
            'Key': 'string',
            'Value': 'string',
            'SyncCount': 123,
            'LastModifiedDate': datetime(2015, 1, 1),
            'LastModifiedBy': 'string',
            'DeviceLastModifiedDate': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string',
    'Count': 123,
    'DatasetSyncCount': 123,
    'LastModifiedBy': 'string',
    'MergedDatasetNames': [
        'string',
    ],
    'DatasetExists': True|False,
    'DatasetDeletedAfterRequestedSyncCount': True|False,
    'SyncSessionToken': 'string'
}

Response Structure

  • (dict) – Returned for a successful ListRecordsRequest.

    • Records (list) – A list of all records.

      • (dict) – The basic data structure of a dataset.

        • Key (string) – The key for the record.

        • Value (string) – The value for the record.

        • SyncCount (integer) – The server sync count for this record.

        • LastModifiedDate (datetime) – The date on which the record was last modified.

        • LastModifiedBy (string) – The user/device that made the last change to this record.

        • DeviceLastModifiedDate (datetime) – The last modified date of the client device.

    • NextToken (string) – A pagination token for obtaining the next page of results.

    • Count (integer) – Total number of records.

    • DatasetSyncCount (integer) – Server sync count for this dataset.

    • LastModifiedBy (string) – The user/device that made the last change to this record.

    • MergedDatasetNames (list) – Names of merged datasets.

      • (string) –

    • DatasetExists (boolean) – Indicates whether the dataset exists.

    • DatasetDeletedAfterRequestedSyncCount (boolean) – A boolean value specifying whether to delete the dataset locally.

    • SyncSessionToken (string) – A token containing a session ID, identity ID, and expiration.

Exceptions

  • CognitoSync.Client.exceptions.InvalidParameterException

  • CognitoSync.Client.exceptions.NotAuthorizedException

  • CognitoSync.Client.exceptions.TooManyRequestsException

  • CognitoSync.Client.exceptions.InternalErrorException