Welcome to the documentation for the Nancy64-bit Customer Management Application! 🎉 This project aims to provide you with APIs to seamlessly manage customer data. Below, you will find all the information you need to integrate these APIs into your application.
To begin, make sure you have the project set up and running:
-
Clone the repository:
git clone https://github.com/Nancy64-bit/customer-management-application.git
-
Build the Spring application using Gradle:
./gradlew build
-
Start the server:
./gradlew bootrun
Note: Please wait until the build process is completed and the server is up and running.
Authenticate users using the provided credentials to obtain a Bearer token for subsequent API calls.
- Path: https://qa2.sunbasedata.com/sunbase/portal/api/assignment_auth.jsp
- Method: POST
- Body:
{ "login_id": "test@sunbasedata.com", "password": "Test@123" } - Response:
- Success: Bearer token for further API calls
- Failure: 401, Invalid Authorization
Integrate this API to create a new customer.
- Path: https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp
- Method: POST
- Parameters:
- cmd: create
- Header:
- Authorization: Bearer token_recieved_in_authentication_API_call
- Body:
{ "first_name": "Jane", "last_name": "Doe", "street": "Elvnu Street", "address": "H no 2", "city": "Delhi", "state": "Delhi", "email": "sam@gmail.com", "phone": "12345678" } - Response:
- Success: 201, Successfully Created
- Failure: 400, First Name or Last Name is missing
Retrieve the list of customers using this API.
- Path: https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp
- Method: GET
- Parameters:
- cmd: get_customer_list
- Header:
- Authorization: Bearer token_recieved_in_authentication_API_call
- Response:
[ { "first_name": "Jane", "last_name": "Doe", "street": "Elvnu Street", "address": "H no 2", "city": "Delhi", "state": "Delhi", "email": "sam@gmail.com", "phone": "12345678" } ]
Delete a specific customer using this API.
- Path: https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp
- Method: POST
- Parameters:
- cmd: delete
- uuid: uuid_of_a_specific_customer
- Header:
- Authorization: Bearer token_recieved_in_authentication_API_call
- Response:
- Success: 200, Successfully deleted
- Failure: 500, Error Not deleted
- Failure: 400, UUID not found
Update an existing customer's information using this API.
- Path: https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp
- Method: POST
- Parameters:
- cmd: update
- uuid: uuid_of_a_specific_customer
- Header:
- Authorization: Bearer token_recieved_in_authentication_API_call
- Body:
{ "first_name": "Jane", "last_name": "Doe", "street": "Elvnu Street", "address": "H no 2", "city": "Delhi", "state": "Delhi", "email": "sam@gmail.com", "phone": "12345678" } - Response:
- Success: 200, Successfully Updated
- Failure: 500, UUID not found
- Failure: 400, Body is Empty
You can use cURL commands to test the API endpoints:
# Authenticate and get Bearer token
curl -X POST -H "Content-Type: application/json" -d '{"login_id": "test@sunbasedata.com", "password": "Test@123"}' https://qa2.sunbasedata.com/sunbase/portal/api/assignment_auth.jsp
# Create a new customer
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer token_recieved_in_authentication_API_call" -d '{"first_name": "Jane", "last_name": "Doe", "street": "Elvnu Street", "address": "H no 2", "city": "Delhi", "state": "Delhi", "email": "sam@gmail.com", "phone": "12345678"}' https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp?cmd=create
# Get customer list
curl -X GET -H "Authorization: Bearer token_recieved_in_authentication_API_call" https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp?cmd=get_customer_list
# Delete a customer
curl -X POST -H "Authorization: Bearer token_recieved_in_authentication_API_call" -d "cmd=delete&uuid=uuid_of_a_specific_customer" https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp
# Update a customer
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer token_recieved_in_authentication_API_call" -d '{"first_name": "Jane", "last_name": "Doe", "street": "Elvnu Street", "address": "H no 2", "city": "Delhi", "state": "Delhi", "email": "sam@gmail.com", "phone": "12345678"}' https://qa2.sunbasedata.com/sunbase/portal/api/assignment.jsp?cmd=update&uuid=uuid_of_a_specific_customerFeel free to contact me if you want to work on any open issues! 🚀🔧🎈