Documentation Archive

Developer

CloudKit Web Services Reference

On This Page

Fetching Current User (users/current)

You can get information about the user who is currently signed in.

Path

GET [path]/database/[version]/[container]/[environment]/public/users/current

Parameters

path

The URL to the CloudKit web service, which is https://api.apple-cloudkit.com.

version

The protocol version—currently, 1.

container

A unique identifier for the app’s container. The container ID begins with iCloud..

environment

The version of the app’s container. Pass development to use the environment that is not accessible by apps available on the store. Pass production to use the environment that is accessible by development apps and apps available on the store.

Response

If the user is discoverable, this request returns the user’s name in a dictionary with the following keys:

Key

Description

userRecordName

The name of the user record.

firstName

The user’s first name.

lastName

The user’s last name.

Discussion

Fetching current users returns the user ID and their name if they are discoverable.