cktool query-records

I cannot seem to get cktool query-records to work no matter what I do. I get the following very generic error message. Even when I use the commands you provide in the man page:

❌ An error occurred while performing the command.
Operation: query
Session has expired or is invalid. A new user token may be required.

However, when I run get-teams, or export-schema it works just fine. I'm unsure if this tool is ready for release tbh.

Replies

Hi, for management operations, you need a management token, available from https://icloud.developer.apple.com/dashboard/account/tokens which it seems like you successfully have added. For querying records, you need a user token, from the same page.

The user token is short lived (hours) but grants you permission to query the database.

Can you please confirm that you have added a user token prior to querying?

  • Ugh, you're exactly right. It was the user token. Sorry for the frustration. I did not realize the user token is so short lived. Is there any way around this, as I would like to use this in a CI environment.

Add a Comment