The document that mentioned on eAPI Dashboard details and guideline, this is the reality API with the common methods, it will support and help testers to work and practice on the APIs.
These APIs are publicly and support for the testing purposes only. Do not submit the real and sensitive information.
If you have any questions, please feel free to drop me a message via [email protected], I appreciate your feedback, contributing and ideas.
- Homepage: https://sangbui.com/api/index.php
- API Endpoint: https://sangbui.com/api/v1/employees
1. Get all employees data
This API will retrieving all employees data from the table and return information that included name, salary and age.
URL | https://sangbui.com/api/v1/employees |
Method | GET |
URL Params | <none> |
Header | Content-Type: application/json
Authorization: Basic d2ViX2FwcDpjaGFuZ2VpdA== |
Data Params | <none> |
Success Response | Code: 200 OK
Content: [ { “id”: “<id>”, “employee_name”: “<name>”, “employee_salary”: “<salary>”, “employee_age”: “<age>” }, { “id”: “<id>”, “employee_name”: “<name>”, “employee_salary”: “<salary>”, “employee_age”: “<age>” } ] |
Error Response | Code: 404 Not Found |
Sample Call | <none> |
Notes | <none> |
2. Get an employee by ID
This API will retrieving one employee by the employee_id, the response data will show all details of that ID.
URL | https://sangbui.com/api/v1/employees/<employee_id> |
Method | GET |
URL Params | <employee_id> |
Header | Content-Type: application/json
Authorization: Basic d2ViX2FwcDpjaGFuZ2VpdA== |
Data Params | <none> |
Success Response | Code: 200 OK
Content: [ { “id”: “<id>”, “employee_name”: “<name>”, “employee_salary”: “<salary>”, “employee_age”: “<age>” } ] |
Error Response | Code: 404 Not Found |
Sample Call | http://localhost/employee_api/v1/employees/1 |
Notes | In our database, the employee_id from 1 to 15 will be stable and will not removed, so you can use these IDs for testing and get the sample data. |
3. Add new employee
This API will suport for adding the new employee to the database. The employee_id will be auto increment.
Check the new submitted records at the home page. It will show 10 latest records and all value from the employee table.
URL | https://sangbui.com/api/v1/employees |
Method | POST |
URL Params | <none> |
Header | Content-Type: application/json
Authorization: Basic d2ViX2FwcDpjaGFuZ2VpdA== |
Data Params | {
“employee_name” : “<name>”, “employee_salary”: “<salary>”, “employee_age”: “<age>” } |
Success Response | Code: 200 OK
Content: { “status”: 1, “status_message”: “Employee added successfully!” } |
Error Response | Code: 404 Not Found |
Sample Call | {
“employee_name” : “An”, “employee_salary”: “1000”, “employee_age”: “29” } |
Notes | Check the new submitted records ID and details at the home page. |
4. Update an employee information
This API will help to update an employee information by the employee_id.
URL | https://sangbui.com/api/v1/employees |
Method | PUT |
URL Params | <none> |
Header | Content-Type: application/json
Authorization: Basic d2ViX2FwcDpjaGFuZ2VpdA== |
Data Params | {
“id”: “<id>”, “employee_name”: “<new_name>”, “employee_salary”: “<new_salary>”, “employee_age”: “<new_age>” }
|
Success Response | Code: 200 OK
Content: { “status”: 1, “status_message”: “Employee updated successfully.” }
|
Error Response | Code: 404 Not Found |
Sample Call | {
“id” : 7, “employee_name” : “Nam”, “employee_salary”: “800”, “employee_age”: “25” } |
Notes | <none> |
5. Delete an employee
This API will support to delete an employee by the employee_id.
URL | https://sangbui.com/api/v1/employees |
Method | DELETE |
URL Params | <none> |
Header | Content-Type: application/json
Authorization: Basic d2ViX2FwcDpjaGFuZ2VpdA== |
Data Params | {
“id” : <id> } |
Success Response | Code: 200 OK
Content: { “status”: 1, “status_message”: “Employee deleted successfully.” }
|
Error Response | Code: 404 Not Found |
Sample Call | {
“id” : 5 } |
Notes | <none> |
One Comment