Endpoint
One endpoint of an API on a plate: method, path, what it does and how to authenticate.
import Endpoint from '@sypnia/ui/astro/Endpoint.astro'
On this page
Read, write, delete
The method has its colour; the slot badges holds a version or where it exists.
GET
/v1/tables/{table}/rows The rows of a table, 20 at a time, newest first.
POST
/v1/tables/{table}/rows v1.4 Adds rows; up to 500 in one call.
DELETE
/v1/tables/{table} Deletes the table and its rows.
Code
---
import Endpoint from '@sypnia/ui/astro/Endpoint.astro';
import VersionBadge from '@sypnia/ui/astro/VersionBadge.astro';
---
<div class="sy-docs sy-stack" style="min-height:0;background:none;--gap:var(--s-4)">
<Endpoint method="GET" path="/v1/tables/{table}/rows" auth="API token (read)">The rows of a table, 20 at a time, newest first.</Endpoint>
<Endpoint method="POST" path="/v1/tables/{table}/rows" auth="API token (write)"><VersionBadge slot="badges" version="1.4" status="new" />Adds rows; up to 500 in one call.</Endpoint>
<Endpoint method="DELETE" path="/v1/tables/{table}" auth="API token (admin)">Deletes the table and its rows.</Endpoint>
</div> When to use it
Use it when
- API reference pages, followed by Params, RequestExample, ResponseExample and ErrorList.
Do not use it when
- Mentioning an endpoint inside a sentence: write it as
code.
For everyone
- The method is written, not only coloured.
- With
titleit gets a heading, so it shows in «On this page».