Product Updates

DatoCMS changelog for new features and general improvements
API Clients Content Management API

Released v0.6 of Ruby client

June 10th, 2018

We just rolled version 0.6 of our Ruby client!

The big change is that the methods the client makes available are generated at runtime based on the JSON Schema of our CMA. This means any new API endpoint — or changes to existing ones — will instantly be reflected to the client, without the need to upgrade to the latest client version.

We also added a new deserialize_response option to every call, that you can use if you want to retrieve the exact payload the DatoCMS returns:

1
require "dato"
2
client = Dato::Site::Client.new("YOUR-API-KEY")
3
4
# `deserialize_response` is true by default:
5
access_token = client.access_tokens.create(name: "New token", role: "34")
6
7
# {
8
# "id" => "312",
9
# "hardcoded_type" => nil,
10
# "name" => "New token",
11
# "token" => "XXXX",
12
# "role" => "34"
13
# }
14
15
# if `deserialize_response` is false, this will be the result
16
access_token = client.access_tokens.create(
17
{ name: "New token", role: "34" },
18
deserialize_response: false
19
)
20
21
# {
22
# "data": {
23
# "type": "access_token",
24
# "id": "312",
25
# "attributes": {
26
# "name": "New token",
27
# "token": "XXXX",
28
# "hardcoded_type": nil
29
# },
30
# "relationships": {
31
# "role": {
32
# "data": {
33
# "type": "role",
34
# "id": "34"
35
# }
36
# }
37
# }
38
# }
39
# }

In our doc pages we also added some examples for the super-handy all_pages option which was already present since v0.3.29:

# if you want to fetch all the pages with just one call:
client.items.all({ "filter[type]" => "44" }, all_pages: true)
Start using DatoCMS today
According to Gartner 89% of companies plan to compete primarily on the basis of customer experience this year. Don't get caught unprepared.
  • No credit card
  • Easy setup
Subscribe to our newsletter! 📥
One update per month. All the latest news and sneak peeks directly in your inbox.
support@datocms.com ©2024 Dato srl, all rights reserved P.IVA 06969620480