Appearance
Address Master
Overview
The Address Master API enables the creation, retrieval, updating, and deletion of address master records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.
Create
Endpoint: /api/message/address_master/{ Company }
This API will create a new Address master.
- Method: POST
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"data_set": "<Data-set>", //string
"adrs_city": "<city-name>", //string
"adrs_code": "<address-code>", //string
"adrs_country": "<counrty-name>", //string
"adrs_line0": "<address-line-0>", //string
"adrs_line1": "<address-line-1>", //string
"adrs_line2": "<address-line-2>", //string
"adrs_nama": "<address-name>", //string
"adrs_state": "<state-code>", //string
"adrs_telp": "<telephone-number>", //string
"postal_zone": "<postal-zone>" //string
}Fields Details:
| Field Name | Description | Data Type | Length |
|---|---|---|---|
| data_set | Data Set | String | 10 |
| adrs_code | Adress Code | String | 9 |
| adrs_nama | Address Name | String | 140 |
| adrs_line0 | Address Line 0 | String | 400 |
| adrs_line1 | Address Line 1 | String | 400 |
| adrs_line2 | Address Line 2 | String | 400 |
| postal_zone | Postal Zone | String | 10 |
| adrs_city | City Name | String | 150 |
| adrs_state | State | String | 3 |
| adrs_country | Country | String | 3 |
| adrs_telp | Telephone | String | 15 |
Response Body: (Status: 200)
json
{
"adrs_city": "<city-name>",
"adrs_code": "<address-code>",
"adrs_country": "<country-code>",
"adrs_line0": "<addess-line-0>",
"adrs_line1": "<address-line-1>",
"adrs_line2": "<address-line-2>",
"adrs_nama": "<address-name>",
"adrs_state": "<state-code>",
"adrs_telp": "<telephone-number>",
"data_set": "<Data-set>",
"postal_zone": "<postal-zone>",
}Fields Details:
| Field | Description | Data Type | Example |
|---|---|---|---|
| adrs_city | City Name | String | "BAHRU' |
| adrs_code | Address Code | String | "AAPR01" |
| adrs_country | Country | String | "MYS" |
| adrs_line0 | Address line 0 | String | "1,4,5" |
| adrs_line1 | Address line 1 | String | "2,4,1" |
| adrs_line2 | Address line 2 | String | "NEW TAIPEI CITY 239 TAIWAN R.O" |
| adrs_nama | Address Name | String | "AA PRODUCTS SDN BHDN" |
| adrs_state | State | String | "01" |
| adrs_telp | Telephone | String | "604-5057233" |
| data_set | Data Set | String | "Dataset1" |
| postal_zone | Postal zone | String | "5320053200" |
Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong Country code is passed:
json
{
"message": "Reference Error: Country Code."
}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 both the Data set and Address Code is already present in the database:
json
{
"message": "Record already exists!"
}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 'adrs_nama'|Validation 'isNotEmpty' failed for field 'adrs_city'|Validation 'isNotEmpty' failed for field 'adrs_state'|Validation 'isNotEmpty' failed for field 'adrs_country'"
}Update
Endpoint: /api/message/address_master/{ Company }
This API will update a Address master.
- Method: PUT
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"data_set": "<Data-set>", //string
"adrs_city": "<city-name>", //string
"adrs_code": "<address-code>", //string
"adrs_country": "<counrty-name>", //string
"adrs_line0": "<address-line-0>", //string
"adrs_line1": "<address-line-1>", //string
"adrs_line2": "<address-line-2>", //string
"adrs_nama": "<address-name>", //string
"adrs_state": "<state-code>", //string
"adrs_telp": "<telephone-number>", //string
"postal_zone": "<postal-zone>" //string
}Response Body: (Status: 200)
json
{
"adrs_city": "<city-name>",
"adrs_code": "<address-code>",
"adrs_country": "<country-code>",
"adrs_line0": "<addess-line-0>",
"adrs_line1": "<address-line-1>",
"adrs_line2": "<address-line-2>",
"adrs_nama": "<address-name>",
"adrs_state": "<state-code>",
"adrs_telp": "<telephone-number>",
"data_set": "<Data-set>",
"postal_zone": "<postal-zone>",
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong Country code is passed:
json
{
"message": "Reference Error: Country Code."
}Response Body: (Status: 400 - Bad Request)
When you are trying to update both the Data set and Address code:
json
{
"message": "Record not found!"
}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 'adrs_nama'|Validation 'isNotEmpty' failed for field 'adrs_city'|Validation 'isNotEmpty' failed for field 'adrs_state'|Validation 'isNotEmpty' failed for field 'adrs_country'"
}Delete
Endpoint: /api/message/address_master/{ Company }/{ record_id }
This API will delete a Address master.
- 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 Address master id is paased:
json
{
"Message": "Unable to Delete Record - Invalid Data Type"
}Get
Endpoint: /api/message/address_master/{ Company }/{ record_id }
This API will get a Address master.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"adrs_city": "<city-name>",
"adrs_code": "<address-code>",
"adrs_country": "<country-code>",
"adrs_line0": "<addess-line-0>",
"adrs_line1": "<address-line-1>",
"adrs_line2": "<address-line-2>",
"adrs_nama": "<address-name>",
"adrs_state": "<state-code>",
"adrs_telp": "<telephone-number>",
"data_set": "<Data-set>",
"postal_zone": "<postal-zone>",
}Response Body: (Status: 200)
When invalid or wrong Address master 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/address_master/{ Company }/{ PageSize }/{ PageNumber }
This API will get all Address masters.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
[
{
"adrs_city": "<city-name>",
"adrs_code": "<address-code>",
"adrs_country": "<country-code>",
"adrs_line0": "<addess-line-0>",
"adrs_line1": "<address-line-1>",
"adrs_line2": "<address-line-2>",
"adrs_nama": "<address-name>",
"adrs_state": "<state-code>",
"adrs_telp": "<telephone-number>",
"data_set": "<Data-set>",
"postal_zone": "<postal-zone>",
},
.
.
.
]Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}