Opti CMS Dynamic API Endpoints

Opti CMS Add-On
C#
GitHub Repository

What It Is

An add-on which allows editors to create API endpoints from the UI

Status

Last Reviewed:

Wrote it for a POC. Never used it.

Details

This came out of my belief that dumping raw APIs on front-end developers was counterproductive, and that we should be controlling these endpoints separate.

So, instead of saying, “Here’s the API doc, do what you want,” we should be figure out what they need, and give them an endpoint that gives them exactly that.

This add-on allows you to create “pages” in Opti CMS that are really API endpoints. You can specify exactly what they should return, and in what format.

For example, if your app needs the latest five news articles, this would let an editor create that endpoint (as a page), specify the search required to return those endpoints (using the TreeQL syntax, and exactly what properties to return from the resulting content (using the ObjectTranslator).

(Note: I wrote those two other projects specifically to support this one.)

However, I wrote this before Optimizely Graph became a thing. That would likely be a better choice at this point (though, again, it suffers from a complicated syntax – your front-end devs need to understand GraphQL).

I still think there’s a place for something like this. I’m quite convinced that we need to do less API configured on the consuming client end – we should just be using endpoints, the results of which are centrally controlled.

Here’s a 15-minute video showing how it works.