AWS Free Certification Courses

Please go to our Blogger site at blog.backspace.academy This site will no longer be updated.

Add CognitoSync Records

Now that we have our CognitoSync session token we can use this to add, modify or delete CognitoSync dataset records.

To demonstrate we are going to call addRecord to add a record. Open app.js in your editor and add a call to the addRecord in the callback of getCognitoSynToken().

Now lets add a record user_id that stores the users facebook id. We need to not only pass the CognitoSync session token but also the sync count that we got from the call to listRecords. There is a call to a function createS3() in the callback of addRecord() below, please comment this out for now as we will be building this later.

Now you can build and run your app. You should be able to login to Facebook and add a user record to the dataset.

We can also use our CognitoID credentials to access other AWS resources. Next we will access an S3 bucket and add a folder and file to it.

Next Access an S3 Bucket