The API can serve for both mobile and web based solution for logistic service which allows for various, logistic companies move parcels and also allow the owner of the parcel track their parcel. Logistics company can register to partner with each other i.e. a logistic company can pick up a percel, and deliver to a state they don't cover.
CLONE THE REPOSITORY AND SETUP A VIRTUAL ENVIRONMENT TO RUN THE PROJECT,
LIVE API AT HERE
A SWAGGER UI is also added at {{BASE_URL}}/swagger
{{BASE_URL}}/register
{
"username": "johndoe",
"password": "password",
"email": "user@example.com"
}
[!NOTE] the email address is a unique field
{{BASE_URL}}/api/token
{
"username": "johndoe",
"password": "password"
}
This will return access token and refresh token
access token: The access token has a life span of 60 MINUTES after creation
refresh token: The refresh token has a life span of 1 DAY (24 Hours)
{{BASE_URL}}/api/token/blacklist/
{
"refresh": "refresh_token"
}
blacklisting a token will disable the refresh token and its access token
[!NOTE] on the frontend (WEB/MOBILE) the refresh and access token should be removed from the local storage as well
{{BASE_URL}}/api/token/refresh/
{
"refresh": "string"
}
Takes a refresh type JSON web token and returns an access type JSON web
token if the refresh token is valid.
{{BASE_URL}}/parks/
{BASE_URL}/parks/
{
"park_name": "string",
"park_address": "string",
"park_local_govt_area": "string",
"park_state": "string"
}
{{BASE_URL}}/parks/{{PARK_ID}}
[!NOTE] only the creator of a park can modify a park record, and delete record
{{BASE_URL}}/parks/{{PARK_ID}}
{
"park_name": "string",
"park_address": "string",
"park_local_govt_area": "string",
"park_state": "string"
}
{{BASE_URL}}/partners/
{{BASE_URL}}/partners/
{
"company_name": "string",
"company_email": "string",
"company_address": "string",
"owners_name": "string",
"owners_address": "string",
"owners_phone": "string",
"verification_status": "NOT VERIFIED",
"logistic_type": "string"
}
{{BASE_URL}}/partners/{{PARTNER_ID}}
{{BASE_URL}}/parcel-pickup/[!NOTE] A PARTNER RECORD CAN BE DELETED, AND UPDATED
{{BASE_URL}}/parcel-pickup/
{
"lastname": "string",
"firstname": "string",
"email": "string",
"phone_number": "string",
"nearest_landmark": "string",
"parcel_type": "string",
"parcel_weight": "string",
"alternative_phone": "string",
"status": "PICKED UP (OPTIONAL, Which will default to REQUESTED)"
}
{{BASE_URL}}/parcel-pickup/{{id}}
This will allow parcel data being modified maybe due to error in weight record and delete a record or parcel
{{BASE_URL}}/parcels/
{
"riders_contact": "string",
"parcel_status": "DELIVERED",
"parcel": {
"lastname": "string",
"firstname": "string",
"email": "string",
"phone_number": "string",
"nearest_landmark": "string",
"parcel_type": "string",
"parcel_weight": "string",
"alternative_phone": "string",
"status": "PICKED UP"
},
"current_location": {
"park_name": "string",
"park_address": "string",
"park_local_govt_area": "string",
"park_state": "string"
}
}
[!NOTE] both parcel and current location are based on data already entered as PARCEL and PARKS Data respectively
{{BASE_URL}}/parcels/{{parcel_id}}