API Updates & Documentation

Earlier today we pushed out some changes to our API endpoints. Let's take a look at them.

A better metric points endpoint

Essentially we've made sure that a metric point is always treated as a child of a metric throughout the API.

Previously you'd fetch metric points with:

GET /api/metrics/points/{id}  

Where id is the metric id. This makes no sense as a RESTful API and as such we've now changed this to:

GET /api/metrics/{id}/points  

Create metric points endpoint

We've also made the same change above, but to the creation of endpoints.

POST /api/metrics/{id}/points  

Must now be used to create a new metric point.

You can now update a metric point

Previously, once a metric point had been created there was no going back. That data was frozen - unless you went into the database and manually modified the data. That's no longer the case!

Simply PUT the same fields to this endpoint and the metric point will update.

PUT /api/metrics/{id}/points/{point_id}  

Where id is still the metric id and point_id is the point of data that you want to update.

You can also delete a metric point

Also new is the ability to delete a metric point:

DELETE /api/metrics/{id}/points/{point_id}  

And just like that, it's gone.

Updated documentation

Of course, now that Cachet is being used by so many people we've seen a rise in requests for documentation on metrics, the API and how to get setup.

Whilst it's always been in our plan to get the documentation written, it's never been high priority. That's wrong. We should have been writing documentation as we added endpoints. It's a lesson we've learnt and will continue to act upon in the future.

Although not complete, you can see the progress at http://docs.cachethq.io

Currently we're not running CloudFlare HTTPS on this domain as it caches for far too long and updates were not being shown.

New support setup

If you need extra support, then you can now email us at support@cachethq.io. Your email is then processed by HelpScout which will help myself and any other team members answer support emails in a far more organised system.

Share Comment on Twitter