This is the Django RESTful API for MailSafe Application. The endpoints can be tested locally using PostMan with the endpoints provided below. The docker container uses the Alpine image.
NOTE ALL ENDPOINTS ARE RESTRICTED VIA Authenticated Header
Authorization : Token
Access Admin panel via browser directly
admin/
Access to domains
alias/<str:DOMAIN>'
Login token requires payload
/auth/users/token/email/
payload
{
"username": "admin",
"password": "123"
}
response
{
"token": "",
"user_id": ""
}
Delete
v1/domains/:domain/aliases/:id
Domains
def get_alias_filtered(request, DOMAIN):
"""
Return Domain filtered by domain
API_ENDPOINT:api/v1/alias/<domains>
Json raw body
---------------
Auth will be header with key Authorization : Token a85efc83ccb629878a4d6d15e1fc1ffb51136da9
{
"name": "432",
"recipients": "random@email.com",
"is_enabled": true
}
docker build .
docker-compose build
This should install all required packages and setup the container.docker-compose up
this should run server on localhost:8000docker-compose run app sh -c "python manage.py migrate"