Skip to main content
It needs Ruby 3.3 or newer and uses only Ruby’s standard library (Net::HTTP, JSON, OpenSSL). Use it on servers: API keys are secrets. The overview covers reading and writing, retries, errors, uploads and webhooks, with examples in every language.

Configure the client

API keys belong to a project, so methods like collections.list need no project ID, and collections can be named by ID or slug.

Results

The API’s resources come back as Nohead::NoheadObjects:
  • Read fields with methods (record.data) or [] (record[:data], record["data"]), at any depth. Fields named like Ruby’s own methods (method, hash) need [].
  • Timestamps (created_at, purge_after, a scheduled change’s at) are Times. A record’s field values in data stay as they come.
  • Unknown fields are kept, because the API adds fields and values without notice. to_h gives the raw Hash.

Images

Nohead::Images.url builds an image URL with resizing options: see Images.

Methods

Every method follows a resource of the API: records, drafts, collections, fields, migrations, assets, webhooks, search, audit_events and more. Each endpoint in the API reference shows its call in Ruby, and the README lists them by resource.

Source

The SDK is open source, under the MIT license. Report issues and follow releases on GitHub:
nohead-io/nohead-ruby
Loading repository data...