How to create cognito dataset ? can't find example or explanation anywhere

0

Greetings, I'm trying to create a new dataset for an existing identity in cognito, using php sdk 3, but I can't seem to find any actual explanation or example of how to do this. Not even the API reference seems to have a method to create a new dataset...

In some places it is said that cognito will create a dataset if it doesn't exist... but there is no actual explanation of which method, event or action will trigger this.

I've tried describeDataset and listDatasets but the dataset is not created if it doesn't exist... updateRecords does work, but only if the dataset exists, because I can't get a sync token if there is no dataset in the first place.

I would really appreciate any help or ideas to create a dataset using php, even if it's using the raw API or an AWS CLI command.
Thank you.

pcriado
已提問 5 年前檢視次數 292 次
1 個回答
0

In case anyone wonders, I figured it out after much trial and error. In both the php and nodejs sdks you have to call listRecords() with the new dataset name, retrieve the syncToken from that response, and then call updateRecords() with the new dataset name and the syncToken from the previous call.

This tiny bit of information appears to be missing from all the docs available... extremely unfortunate IMHO...

pcriado
已回答 5 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南