Documentation Archive

Developer

CloudKit Web Services Reference

On This Page

Fetching Subscriptions (subscriptions/list)

You can fetch all the subscriptions in the specified database.

Path

GET [path]/database/[version]/[container]/[environment]/[database]/subscriptions/list

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.

database

The database to store the data within the container. Pass public to use the database that is accessible to all users of the app. Pass private to use the database that is visible only to the currently signed-in user.

Response

The response is a dictionary containing the results for each subscription with the following key:

Key

Description

subscriptions

An array containing one dictionary for each subscription. If the fetch of a subscription was successful, the dictionary contains the subscription information, described in Subscription Dictionary. If the fetch of a subscription was unsuccessful, the dictionary is an error dictionary, described in Subscription Fetch Error Dictionary. This key is required.

Subscription Fetch Error Dictionary

This dictionary describes a failed subscription fetch with the following keys:

Key

Description

subscriptionID

A string that is a unique identifier for the subscription.

reason

A string indicating the reason for the error.

serverErrorCode

A string containing the code for the error that occurred. For possible values, see Error Codes.

redirectURL

A redirect URL for the user to securely sign in using their Apple ID. This key is present when serverErrorCode is AUTHENTICATION_REQUIRED.

Related Framework API

This request is similar to using the CKFetchSubscriptionsOperation class in the CloudKit framework.