GET https://{API_DOMAIN}/api/v1/state
curl -X GET
-H "Content-Type: application/json"
"https://{API_HOST}/api/v1/country?per_page=3"
{
"data": [
{
"id": 1,
"name": "台灣",
"abbrev": null
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": "3",
"to": 1,
"total": 1
}
}
GET https://{API_DOMAIN}/api/v1/state
curl -X GET
-H "Content-Type: application/json"
"https://{API_HOST}/api/v1/state?per_page=3"
{
"data": [
{
"id": 2,
"country_id": 1,
"name": "基隆市",
"country": {
"id": 1,
"name": "台灣",
"abbrev": null
}
},
{
"id": 3,
"country_id": 1,
"name": "台北市",
"country": {
"id": 1,
"name": "台灣",
"abbrev": null
}
},
{
"id": 4,
"country_id": 1,
"name": "新北市",
"country": {
"id": 1,
"name": "台灣",
"abbrev": null
}
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 8,
"per_page": "3",
"to": 3,
"total": 23
}
}
GET https://{API_DOMAIN}/api/v1/city
curl -X GET
-H "Content-Type: application/json"
"https://{API_HOST}/api/v1/city?per_page=3"
{
"data": [
{
"id": 1,
"state_id": 2,
"state": {
"id": 2,
"country_id": 1,
"name": "基隆市"
},
"name": "仁愛區",
"zipcode": "200"
},
{
"id": 2,
"state_id": 2,
"state": {
"id": 2,
"country_id": 1,
"name": "基隆市"
},
"name": "信義區",
"zipcode": "201"
},
{
"id": 3,
"state_id": 2,
"state": {
"id": 2,
"country_id": 1,
"name": "基隆市"
},
"name": "中正區",
"zipcode": "202"
}
],
"meta": {
"current_page": 1,
"from": 1,
"last_page": 124,
"per_page": "3",
"to": 3,
"total": 371
}
}