Skip to content

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 NameDescriptionData TypeLength
data_setData SetString10
adrs_codeAdress CodeString9
adrs_namaAddress NameString140
adrs_line0Address Line 0String400
adrs_line1Address Line 1String400
adrs_line2Address Line 2String400
postal_zonePostal ZoneString10
adrs_cityCity NameString150
adrs_stateStateString3
adrs_countryCountryString3
adrs_telpTelephoneString15

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:

FieldDescriptionData TypeExample
adrs_cityCity NameString"BAHRU'
adrs_codeAddress CodeString"AAPR01"
adrs_countryCountryString"MYS"
adrs_line0Address line 0String"1,4,5"
adrs_line1Address line 1String"2,4,1"
adrs_line2Address line 2String"NEW TAIPEI CITY 239 TAIWAN R.O"
adrs_namaAddress NameString"AA PRODUCTS SDN BHDN"
adrs_stateStateString"01"
adrs_telpTelephoneString"604-5057233"
data_setData SetString"Dataset1"
postal_zonePostal zoneString"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!"
}