Welcome to the API documentation for the Blog Application! This document provides information on how to interact with canto APIs.
Canto API allows businesses in a specific location, area or gated community to be added to a directory of businesses that can be seached based on keywords.
- Authentication
- Multipe image upload
- Search with keywords
- View details of the Business
- Python
- Docker
- Sqlalchemy
- PostgreSQL
- Pytest
- Swagger API Spec
- Uvicorn server
Before using the API endpoints, you must authenticate yourself. We use JSON Web Tokens (JWT) for authentication. To authenticate, include an Authorization
header with a valid token in your request.
Example:
Authorization: Bearer YOUR_ACCESS_TOKEN
This enpoints are for those that can add a business to the application.
Endpoint | Method | Description |
---|---|---|
/admins |
GET |
Retrieve a list of all admins. |
/admins/{admin_id} |
GET |
Retrieve a specific detail of admin by its ID. |
/admin |
POST |
Create an admin account. |
/admins/{admin_id} |
PUT |
Update an existing admin by its ID. |
/admins/{admin_id} |
DELETE |
Delete an admin account by its ID. |
/admins/login |
POST |
Admin can login to account. |
/admins/{admin_id}/image |
POST |
Add display image for admin. |
These endpoints are just to categorize the business into various types and categories are based on the Admins intuition.
Endpoint | Method | Description |
---|---|---|
/business/type |
GET |
Retrieve a list of all businesses. |
/business/type/{type_id} |
GET |
Retrieve a specific detail of a business by its ID. |
/business/type |
POST |
Add a business. |
/business/type/{type_id} |
PUT |
Update an existing business by its ID. |
/business/type/{type_id} |
DELETE |
Delete an admin account by its ID. |
These are endpoints for businesses to be added.
Endpoint | Method | Description |
---|---|---|
/business |
GET |
Retrieve a list of all businesses. |
/business/{business_id} |
GET |
Retrieve a specific detail of a business by its ID. |
/business |
POST |
Add a business. |
/business/search?limit=10&offset=0&keyword=rice |
POST |
Search for/about a business by keyword. |
/business/{business_id} |
PUT |
Update an existing business by its ID. |
/business/{business_id} |
DELETE |
Delete an admin account by its ID. |
These are endpoints to add images to the business for people to view more details on them.
Endpoint | Method | Description |
---|---|---|
/business/image/display |
POST |
Add business display image. |
/business/image/display |
DELETE |
Delete business display image. |
/business/image/{image_id} |
DELETE |
Delete an image from a business. |
/business/image/ |
POST |
Add multiple/one image(s) to business. |
/business/image/ |
DELETE |
Delete multiple images from a business. |
Endpoint | Method | Description |
---|---|---|
/business/item/ |
GET |
Retrieve a list of all businesses items. |
/business/item/ |
POST |
Create a business item. |
/business/items/ |
POST |
Add multiple business items to business. |
/business/{business_id}/item/ |
GET |
Retrieve a list of all items that belongs to a business. |
/business/item/{id} |
GET |
Retrieve a single item. |
/business/item/{id} |
PUT |
Update a business item. |
/business/item/{id} |
DELETE |
Delete a business item. |