🏠地址
Last updated
Last updated
此區為聯絡地址欄位對應資料。
GET https://{API_DOMAIN}/api/v1/address
curl -X GET
-H "Content-Type: application/json"
'{"city_id":1}'
https://{API_HOST}/api/v1/address
下表為可使用的過濾條件
{
"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
}
}
https://{API_DOMAIN}/api/v1/address/{address}
shell curl -X GET -H "Content-Type: application/json" https://{API_HOST}/api/v1/address/1
請參考地址回應格式
{
"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
}
}
POST https://{API_DOMAIN}/api/v1/address
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
{
"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
}
}
PUT https://{API_DOMAIN}/api/v1/address/{address}
curl -X PUT
-H "Content-Type: application/json"
'{"address": "仁愛路一段"}'
https://{API_HOST}/api/v1/address/1
請參考地址回應格式
{
"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
}
}
Http status 為 204
DELETE https://{API_DOMAIN}/api/v1/address/{address}
curl -X DELETE
-H "Content-Type: application/json"
https://{API_HOST}/api/v1/address/1
回傳 json 格式
{}