Fetching Records by Record Name (records/lookup)
You can fetch records by record name.
Path
POST [path]/database/[version]/[container]/[environment]/[database]/records/lookup
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 should begin 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. Passproduction
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. The possible values are:
public
The database that is accessible to all users of the app.
private
The database that contains private data that is visible only to the current user.
shared
The database that contains records shared with the current user.
Request
The POST request is a JSON dictionary containing the following keys:
Key |
Description |
---|---|
|
Array of record dictionaries, described in Lookup Record Dictionary, identifying the records to fetch. This key is required. |
|
Dictionary that identifies a record zone in the database, described in Zone ID Dictionary. The default is the database default zone. |
|
An array of strings containing record field names that limits the amount of data returned in this operation. Only the fields specified in the array are returned. The default is |
|
A Boolean value indicating whether number fields should be represented by strings. The default value is |
Lookup Record Dictionary
The lookup record dictionary keys are:
Key |
Description |
---|---|
|
The unique name used to identify the record within a zone. This key is required. |
|
An array of strings containing record field names that limits the amount of data returned in this operation. Only the fields specified in the array are returned. The default is |
Response
An array of dictionaries describing the results of the operation. The dictionary contains a single key:
Key |
Description |
---|---|
records |
An array containing a result dictionary for each record requested. If successful, the result dictionary contains the keys described in Record Dictionary. If unsuccessful, the result dictionary contains the keys described in Record Fetch Error Dictionary. |
Related Framework API
This request is similar to using the CKFetchRecordsOperation
class in the CloudKit framework.
Fetching Records Using a Query (records/query)
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-06-13