RESTful API
The Iridium CMS RESTful API is a powerful tool for building applications and services. It provides a simple and intuitive interface for interacting with your data.
The API is built on top Hono, a powerful and flexible web framework.
These sections will walk you through the API and how to use it using curl
or fetch
, however, the API can also be used via the REST Client for a typesafe experience.
Getting Started
To get started, you'll need to create an API Token to authenticate your requests.
bunx iridium token
All requests to the API must include the Authorization
header with the value of the API token.
For example, to get the current user:
curl -H "Authorization: Bearer {token}" {cmsURL}/api/users/me
Authentication
Authentication is handled by the Authorization
header. The value of the header is a Bearer token that is generated from the API token.
The API token is a randomly generated string that is used to authenticate requests. It is stored in the database and can be revoked at any time via an Administrator.
Next Step
You now have the basics of interacting with the API. See the REST Client for a more advanced and typesafe experience.