Under the request panel, Request Sample shows the request as code to copy into your own project, in:
- Shell / cURL
- JavaScript (
fetch) - PHP (cURL)
- Python (
requests)
The sample follows what you fill in: the address with its query string, the Accept header and, for Create and Update, Content-Type: application/json with your body.
Your API key
Outside the browser the REST API needs an API key to read private records and to make any change. Omeka Classic takes it as one query parameter, key, and the samples put key=YOUR_API_KEY there for you to replace.
Keys belong to users and act with their permissions. To make one, click create a key on your API Keys page in the browser's welcome note (or go to Users, your user, API Keys), give it a label and copy the key. Keep it like a password: anyone with it can do what you can.
Reading public records needs no key: drop key= from the sample and the request is a visitor's.
In the public browser
Samples in the public browser have no key: they read public records.