-
-
Save insidegui/537b5a3227a05534d49970682183854d to your computer and use it in GitHub Desktop.
Fetch records from CloudKit's public database with vanilla Javascript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const query = { | |
"records": [ | |
{ | |
"recordName": "49A20D8A-A213-F2A4-71C3-E0758908F1D5" | |
} | |
] | |
} | |
const container = 'iCloud.br.com.guilhermerambo.ChibiStudioModern' | |
const url = `https://api.apple-cloudkit.com/database/1/${container}/production/public/records/lookup` | |
fetch(url, { | |
'method': 'POST', | |
'headers': {'Content-Type': 'application/json'}, | |
'body': JSON.stringify(query) | |
}).then(response => { | |
response.json().then(json => { | |
console.log(json) | |
}) | |
}).catch(e => { | |
console.error(e) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment