Copy GET https : //{API_DOMAIN}/api/v1/address
Copy curl - X GET
- H "Content-Type: application/json"
'{"city_id":1}'
https : //{API_HOST}/api/v1/address
Copy
{
"data" : [
{
"id" : 2678 ,
"type" : 1 ,
"enum_type" : {
"key" : "MAILING" ,
"value" : 1 ,
"description" : "mail address"
} ,
"address" : "基隆市仁愛區愛一路35號8樓之一" ,
"contact_id" : 1938277 ,
"profile_id" : 1938247 ,
"state" : {
"id" : 2 ,
"country_id" : 1 ,
"name" : "基隆市"
} ,
"state_id" : 2 ,
"country" : {
"id" : 1 ,
"name" : "台灣" ,
"abbrev" : null
} ,
"country_id" : 1 ,
"city" : {
"id" : 1 ,
"state_id" : 2 ,
"name" : "仁愛區" ,
"zipcode" : "200"
} ,
"city_id" : 1 ,
"description" : null
} ,
{
"id" : 2830 ,
"type" : 1 ,
"enum_type" : {
"key" : "MAILING" ,
"value" : 1 ,
"description" : "mail address"
} ,
"address" : "愛一路19號" ,
"contact_id" : 1938482 ,
"profile_id" : 1938452 ,
"state" : {
"id" : 2 ,
"country_id" : 1 ,
"name" : "基隆市"
} ,
"state_id" : 2 ,
"country" : {
"id" : 1 ,
"name" : "台灣" ,
"abbrev" : null
} ,
"country_id" : 1 ,
"city" : {
"id" : 1 ,
"state_id" : 2 ,
"name" : "仁愛區" ,
"zipcode" : "200"
} ,
"city_id" : 1 ,
"description" : null
}
] ,
"links" : {
"first" : "https://firstline.localhost/api/address?per_page=2&city_id=1&page=1" ,
"last" : "https://firstline.localhost/api/address?per_page=2&city_id=1&page=63" ,
"prev" : null ,
"next" : "https://firstline.localhost/api/address?per_page=2&city_id=1&page=2"
} ,
"meta" : {
"current_page" : 1 ,
"from" : 1 ,
"last_page" : 63 ,
"path" : "https://firstline.localhost/api/address" ,
"per_page" : "2" ,
"to" : 2 ,
"total" : 126
}
}
Copy https : //{API_DOMAIN}/api/v1/address/{address}
Copy shell curl - X GET - H "Content-Type: application/json" https : //{API_HOST}/api/v1/address/1
Copy
{
"data" : {
"id" : 1 ,
"type" : 3 ,
"address" : "67, rue Michelle Jones\n81785 Berge" ,
"profile_id" : 1 ,
"state" : {
"id" : 1 ,
"country_id" : 1 ,
"name" : "台北市"
} ,
"state_id" : 1 ,
"country" : {
"id" : 1 ,
"name" : "台灣" ,
"abbrev" : null
} ,
"country_id" : 1 ,
"city" : {
"id" : 1 ,
"state_id" : 1 ,
"name" : "仁愛區" ,
"zipcode" : "200"
} ,
"city_id" : 1 ,
"description" : null
}
}
Copy POST https : //{API_DOMAIN}/api/v1/address
Copy curl - X POST
- H "Content-Type: application/json"
'{"profile_id":1,"country_id":1,"state_id":1,"city_id":1,"address": "67, rue Michelle Jones 81785 Berge"}'
https : //{API_HOST}/api/v1/address
Copy {
"data" : {
"id" : 1 ,
"type" : 3 ,
"address" : "67, rue Michelle Jones\n81785 Berge" ,
"profile_id" : 1 ,
"state" : {
"id" : 1 ,
"country_id" : 1 ,
"name" : "台北市"
} ,
"state_id" : 1 ,
"country" : {
"id" : 1 ,
"name" : "台灣" ,
"abbrev" : null
} ,
"country_id" : 1 ,
"city" : {
"id" : 1 ,
"state_id" : 1 ,
"name" : "仁愛區" ,
"zipcode" : "200"
} ,
"city_id" : 1 ,
"description" : null
}
}
Copy PUT https : //{API_DOMAIN}/api/v1/address/{address}
Copy curl - X PUT
- H "Content-Type: application/json"
'{"address": "仁愛路一段"}'
https : //{API_HOST}/api/v1/address/1
Copy {
"data" : {
"id" : 1 ,
"type" : 3 ,
"address" : "信義路一段" ,
"profile_id" : 1 ,
"state" : {
"id" : 1 ,
"country_id" : 1 ,
"name" : "台北市"
} ,
"state_id" : 1 ,
"country" : {
"id" : 1 ,
"name" : "台灣" ,
"abbrev" : null
} ,
"country_id" : 1 ,
"city" : {
"id" : 1 ,
"state_id" : 1 ,
"name" : "仁愛區" ,
"zipcode" : "200"
} ,
"city_id" : 1 ,
"description" : null
}
}
Copy DELETE https : //{API_DOMAIN}/api/v1/address/{address}
Copy curl - X DELETE
- H "Content-Type: application/json"
https : //{API_HOST}/api/v1/address/1