Did you neuter your docs?

It’s been a while since I’ve had to reference the docs. I was looking at the content management API docs today and it looks like they’ve been slimmed down and the examples removed.

In any documentation that I read, I always find real examples to be the most helpful. In the case of the CMA, especially examples using the filter query param would help a lot.

Just my 2c.

Hey @pherbst!

We’ve been updating the docs, but the examples should still be there. Do you not see the examples anymore? List all records - Record - Content Management API


EDIT: Ahhh wait, this must be an oversight. While the JS examples are there, the HTTP examples are not. Sorry about that! I’ll work on that right away, starting with the filters.

Thanks so much, hope you are well! :smiley:

Thanks @pherbst! Hope you’re looking forward to the weekend :slight_smile: Is it all wintry there yet?

PS I just realized that maaaaaany of our pages are missing robust HTTP examples, especially for query string GETs. This will take a while :frowning: I’ll let you know once the updates are done (probably next week sometime), but for the time being, this is how use the filter param:

Endpoint:
GET https://site-api.datocms.com/items?filter[type]=cat,dog

Required headers:

Authorization: Bearer YOUR-API-TOKEN
Accept: application/json
X-Api-Version: 3

Response example:

Click to expand response
{
  "data": [
    {
      "id": "QHr0FFO0Ro6DtNBrFCwV0A",
      "type": "item",
      "attributes": {
        "name": "Maji",
        "breed": "mixed"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "MtzQYUvbS-S0LM2LZ5QlkQ",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:24:36.462+00:00",
        "updated_at": "2024-01-26T20:24:36.618+00:00",
        "published_at": "2024-01-26T20:24:36.779+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:24:36.779+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "YmES_iXOT3GguMQXoFZcWw",
        "stage": null
      }
    },
    {
      "id": "RGLUGlQiTKiAQuB3D9C_1g",
      "type": "item",
      "attributes": {
        "name": "Higgins",
        "breed": "hovawart"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "MtzQYUvbS-S0LM2LZ5QlkQ",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:23:49.239+00:00",
        "updated_at": "2024-01-26T20:23:49.247+00:00",
        "published_at": "2024-01-26T20:23:49.267+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:23:49.267+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "WvWbSB9iQfG8o2mg_f5K5A",
        "stage": null
      }
    },
    {
      "id": "c89tCUarTvGKxA37acCEWA",
      "type": "item",
      "attributes": {
        "name": "Sheriff",
        "breed": "domestic_longhair"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "JwCG35JtS_y92WZoOq1Ujw",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:23:31.721+00:00",
        "updated_at": "2024-01-26T20:23:31.728+00:00",
        "published_at": "2024-01-26T20:23:31.752+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:23:31.752+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "NidBnbyvSOWwXYuXUyITTA",
        "stage": null
      }
    },
    {
      "id": "HXSb3EkPTfGq539SFwHykg",
      "type": "item",
      "attributes": {
        "name": "Randy",
        "breed": "husky"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "MtzQYUvbS-S0LM2LZ5QlkQ",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:17:16.303+00:00",
        "updated_at": "2024-01-26T20:17:16.315+00:00",
        "published_at": "2024-01-26T20:17:16.359+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:17:16.359+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "GIAAl7J7RaCzNvCngCGFjA",
        "stage": null
      }
    },
    {
      "id": "ZooWL1-CRlSHlVO14yPtcA",
      "type": "item",
      "attributes": {
        "name": "Camper",
        "breed": "maine_coone"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "JwCG35JtS_y92WZoOq1Ujw",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:16:26.357+00:00",
        "updated_at": "2024-01-26T20:16:26.363+00:00",
        "published_at": "2024-01-26T20:16:26.381+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:16:26.381+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "XrsqbJyDS-ayt28ffvaSTQ",
        "stage": null
      }
    },
    {
      "id": "aCiWeOsUT3mxY0KIzUfAhw",
      "type": "item",
      "attributes": {
        "name": "Slinky",
        "breed": "domestic_shorthair"
      },
      "relationships": {
        "item_type": {
          "data": {
            "id": "JwCG35JtS_y92WZoOq1Ujw",
            "type": "item_type"
          }
        },
        "creator": {
          "data": {
            "id": "627975",
            "type": "organization"
          }
        }
      },
      "meta": {
        "created_at": "2024-01-26T20:16:16.796+00:00",
        "updated_at": "2024-01-26T20:16:16.802+00:00",
        "published_at": "2024-01-26T20:16:16.822+00:00",
        "publication_scheduled_at": null,
        "unpublishing_scheduled_at": null,
        "first_published_at": "2024-01-26T20:16:16.822+00:00",
        "is_valid": true,
        "is_current_version_valid": true,
        "is_published_version_valid": true,
        "status": "published",
        "current_version": "Sy_1pONCQEakQsfg6MU5WQ",
        "stage": null
      }
    }
  ],
  "meta": {
    "total_count": 6
  }
}

(BTW, are you not using the nodeJS library anymore? That should make the API easier to work with: @datocms/cma-client-node - npm)

Ok, thank you for the quick response. Appreciate you all working on the docs.