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년 전291회 조회
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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인