Appearance
Selection Code Classification
Overview
The Selection Code API enables the creation, retrieval, updating, and deletion of country code records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.
Create
Endpoint: /api/message/ln_selcde_class_code/{ Company }
This API will creat new Selection code.
- Method: POST
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"data_set": "<Data-set>", //string
"cls_code": "<Selection-code>", //string
"dsca": "<Description>", //string
}Fields Details:
| Field Name | Description | Data Type | Length |
|---|---|---|---|
| data_set | Data Set | String | 10 |
| cls_code | Selection code | String | 3 |
| dsca | Description | String | 120 |
Response Body: (Status: 200)
json
{
"data_set": "<Data_set>",
"cls_code": "<Selection-code>",
"dsca": "<Description>",
}Fields Details:
| Field | Description | Data Type | Example |
|---|---|---|---|
| data_set | Data Set | String | "Dataset1" |
| cls_code | Selection code | String | "123" |
| dsca | Description | String | "Test" |
Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When both the Data set and Selection Code is already present in the database:
json
{
"message": "Record already exists!"
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong Data set is passed:
json
{
"message": "Reference Error"
}Response Body: (Status: 400 - Bad Request)
When there is an invalid data type is passed:
json
{
"message": "Invalid Data Type"
}Response Body: (Status: 500 - Internal Server Error)
When the mandatory fields are passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'cls_code'"
}Update
Endpoint: /api/message/ln_selcde_class_code/{ Company }
This API will update a Country code.
- Method: PUT
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"data_set": "<Data-set>", //string
"cls_code": "<Selection-code>", //string
"dsca": "<Description>", //string
}Response Body: (Status: 200)
json
{
"data_set": "<Data_set>",
"cls_code": "<Selection-code>",
"dsca": "<Description>",
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When there is an invalid data type is passed:
json
{
"message": "Invalid Data Type"
}Response Body: (Status: 400 - Bad Request)
When you are trying to update the both the Data set and Selection code:
json
{
"message": "Record not found!"
}Response Body: (Status: 500 - Internal Server Error)
When the mandatory fields are passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'cls_code'"
}Delete
Endpoint: /api/message/ln_selcde_class_code/{ Company }/{ record_id }
This API will delete a Selection code.
- Method: DELETE
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"Message": "Message Deleted Sucessfully!"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 500 - Internal Server Error)
When invalid or wrong selection code id is paased:
json
{
"Message": "Unable to Delete Record - Invalid Data Type"
}Get
Endpoint: /api/message/ln_selcde_class_code/{ Company }/{ record_id }
This API will get a Selection code.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"data_set": "<Data_set>",
"cls_code": "<Selection-code>",
"dsca": "<Description>",
}Response Body: (Status: 200)
When invalid or wrong Selection code id is paased:
json
{
"message": "null"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Get All
Endpoint: /api/messages/ln_selcde_class_code/{ Company }/{ PageSize }/{ PageNumber }
This API will get all Selction codes.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
[
{
"data_set": "<Data_set>",
"cls_code": "<Selection-code>",
"dsca": "<Description>",
},
.
.
.
]Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}