The Card Status API with Django and Django rest Framework
219
The shivkumar56/zywa-web Docker image is a robust and efficient implementation of the Card Status API, built using Django and Django REST Framework. This API is designed to provide a seamless and reliable interface for managing and tracking the status of cards.
Key Features Django: A high-level Python web framework that encourages rapid development and clean, pragmatic design. Django REST Framework: A powerful and flexible toolkit for building Web APIs, used in conjunction with Django. Usage
This Docker image can be pulled and run with the following commands:
docker pull shivkumar56/zywa-web
docker run -d -p 8000:8000 shivkumar56/zywa-web
After running these commands, the Card Status API will be accessible at http://localhost:8000/api/get_card_status/?query=card id or user contact.
API Endpoints The Card Status API provides several endpoints for managing and retrieving card status information. Detailed API documentation can be found within the application.
GET api/get_card_status/
Parameters
query: The card ID or user’s contact number. This parameter is required. Response
The response is a JSON object that contains the status of the card. The status includes Delivered, DeliveryException, Pickup, and Returned objects related to the card. Each object contains the following fields:
id: The ID of the status.
card: The ID of the related card.
timestamp: The timestamp of the status.
comment: The comment of the status. This field is not included in Pickup and Returned objects.
If no card matches the query parameter, the endpoint returns a 404 status code with an error message.
Example: Request: GET http://localhost:8000/api/get_card_status/?query=test_card
Response:
{ "Delivered": [ { "id": "test_delivered", "card": "test_card", "timestamp": "2022-12-31T23:59:59Z", "comment": "test_comment" } ], "DeliveryException": [ { "id": "test_delivery_exception", "card": "test_card", "timestamp": "2022-12-31T23:59:59Z", "comment": "test_comment" } ], "Pickup": [ { "id": "test_pickup", "card": "test_card", "timestamp": "2022-12-31T23:59:59Z" } ], "Returned": [ { "id": "test_returned", "card": "test_card", "timestamp": "2022-12-31T23:59:59Z" } ] }
Content type
Image
Digest
sha256:8c9967668…
Size
385.9 MB
Last updated
over 2 years ago
docker pull shivkumar56/zywa-web