Using APIs
Standard Endpoints
Section titled “Standard Endpoints”Each resource you describe will be available using RESTful standard patterns. Using part of the example from Creating APIS, the following examples show how to access the data in your API.
Provided the following resource description for post:
post: slug: string title: string body: string published: datetime categories: << category tags: << tagRESTful standard CRUD methods 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="Attaianble 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.