RESTful Endpoints
Each resource you describe will be available using RESTful patterns. If you’re familiar with CRUD (Create, Read, Update, Delete), you’ll find using attainable APIs very easy.
Provided the following resource description for post:
post: slug: string title: string body: string published: datetime categories: << category tags: << tagRESTful CRUD methods will be available for each resource:
GET /postGET /post/:id:POST /postPUT /post/:id:PATCH /post/:id:DELETE /post/:id:Querying
Section titled “Querying”Each resource is also able to be queried with standard HTTP URL query fields:
GET /post?title="://attainable APIS"GET /post?tag="resources"&tag="apis"Sorting
Section titled “Sorting”Each resource can be sorted using familiar :ASC and :DESC suffixes for fields.
It’s possible to sort the responses using the sort query in the URL:
GET /post?sort=title:DESCGET /post?sort=slug:ASCGET /post?sort=createdat:DESCPagination
Section titled “Pagination”You can control the size and the index of the data responses:
GET /post?size=100GET /post?size=50&index=4Relationships
Section titled “Relationships”Each of the resources associations can be retrieved with a standard path pattern:
GET /post/42/tagsGET /post/42/categoriesOpenAPI Documentation
Section titled “OpenAPI Documentation”Each Attainable API has it’s resources available through
automatically generated OpenAPI documentation.
You can reach the documentation by using the /docs path for each API.