Download OpenAPI specification:Download
ログインを行うAPI
| Accept required | string Example: application/json |
| email required | string メールアドレス |
| password required | string パスワード |
{- "email": "tsugarubuta@kmfarm.co.jp",
- "password": "password"
}{- "id": 1,
- "name": "木村牧場"
}id に紐づく、集荷詳細取得を行うAPI
| cargo_booking_id required | integer 集荷ID |
| Accept required | string Example: application/json |
{- "id": 1,
- "date": "2024-07-22",
- "farmer_id": 1,
- "name": "農家A",
- "number_of_flecon": 12,
- "specific_time": "AM",
- "is_staple_rice": true,
- "notes": "到着後インターホンを鳴らさずに電話"
}id に紐づく、集荷更新を行うAPI
DB に表示時間より最新の更新日時が存在する場合 >> 400 を返却
DB に表示時間より最新の更新日時が存在しない場合 >> 更新
| cargo_booking_id required | integer 集荷ID |
| Accept required | string Example: application/json |
| date required | string 集荷予定日 |
| farmer_id required | string 生産者ID |
| number_of_flecon required | integer フレコン数 |
| specific_time | string or null 時間指定 |
| is_staple_rice required | boolean 主食米フラグ |
| notes required | string 備考 |
| operating_time required | integer 稼働時間 |
| opened_at required | string 表示時間 |
{- "date": "2024-07-29",
- "farmer_id": 1,
- "number_of_flecon": 14,
- "specific_time": null,
- "is_staple_rice": true,
- "notes": "到着後インターホンを鳴らさずに電話",
- "operating_time": "02:00:00",
- "opened_at": "2024-07-29 10:00:00"
}{ }集荷登録を行うAPI
DB に表示時間より最新の更新日時が存在する場合 >> 400 を返却
DB に表示時間より最新の更新日時が存在しない場合 >> 登録
| Accept required | string Example: application/json |
| date required | string <date> 集荷予定日 |
| farmer_id required | integer 生産者ID |
| number_of_flecon required | integer フレコン数 |
| specific_time | string or null 時間指定 |
| is_staple_rice required | boolean 主食米フラグ |
| operating_time required | string <time> 稼働時間 |
| opened_at required | string <date> 表示時間 |
{- "date": "2024-07-29",
- "farmer_id": 1,
- "number_of_flecon": 14,
- "specific_time": "AM",
- "is_staple_rice": false,
- "operating_time": "02:00:00",
- "opened_at": "2024-07-29 10:00:00"
}{ }集荷一覧取得を行うAPI
リクエストの日付から日数分の集荷を取得する
生産者の積載量ID の昇順でソートする
| date required | string <date> 日付 |
| number_of_days required | integer 日数 |
| Accept required | string Example: application/json |
{- "cargo_booking_list": [
- {
- "id": 1,
- "name": "秋元 康平",
- "number_of_flecon": 12,
- "specific_time": null,
- "is_staple_rice": true,
- "operating_time": 142,
- "is_completed": false,
- "address_city": "つがる市稲垣町穂積元泉",
- "location_name": null,
- "capacity": "大型",
- "date": "2024-09-11"
}, - {
- "id": 4,
- "name": "岩田 勉",
- "number_of_flecon": 12,
- "specific_time": "AM",
- "is_staple_rice": false,
- "operating_time": 152,
- "is_completed": false,
- "address_city": "北津軽郡中泊町大沢内海原",
- "location_name": null,
- "capacity": "大型",
- "date": "2024-09-11"
}, - {
- "id": 2,
- "name": "石戸谷 柾勝",
- "number_of_flecon": 12,
- "specific_time": null,
- "is_staple_rice": false,
- "operating_time": 152,
- "is_completed": false,
- "address_city": "つがる市稲垣町繁田八重垣",
- "location_name": null,
- "capacity": "中型",
- "date": "2024-09-11"
}, - {
- "id": 3,
- "name": "瓜田 昭三",
- "number_of_flecon": 12,
- "specific_time": "PM",
- "is_staple_rice": false,
- "operating_time": 122,
- "is_completed": false,
- "address_city": "つがる市森田町下相野",
- "location_name": "工場(成田義春さん作業場)",
- "capacity": "中型",
- "date": "2024-09-11"
}
]
}集荷先生産者一覧取得を行うAPI
| Accept required | string Example: application/json |
{- "farmer_list": [
- {
- "id": 1,
- "name": "農家A",
- "name_kana": "のうかえー",
- "address_city": "つがる市木造舘岡",
- "location_name": "木造舘岡",
- "capacity_id": 1,
- "capacity": "中型",
- "travel_time": 90
}, - {
- "id": 2,
- "name": "農家B",
- "name_kana": "のうかびー",
- "address_city": "つがる市木造舘岡",
- "location_name": null,
- "capacity_id": 1,
- "capacity": "中型",
- "travel_time": 90
}, - {
- "id": 3,
- "name": "農家C",
- "name_kana": "のうかしー",
- "address_city": "つがる市柏",
- "location_name": null,
- "capacity_id": 1,
- "capacity": "大型",
- "travel_time": 90
}
]
}idに紐づく、集荷完了フラグを更新するAPI
| cargo_booking_id required | integer |
| Accept required | string Example: application/json |
| is_completed required | boolean 集荷完了フラグ |
{- "is_completed": true
}{ }配車一覧取得を行うAPI
稼働車両の昇順 >> ソート順の昇順
| date required | string <date> 日付 |
| Accept required | string Example: application/json |
{- "vehicle_assignment_list": [
- {
- "id": 1,
- "date": "2024-07-22",
- "cargo_booking_id": 2,
- "operational_vehicle_id": 2,
- "sort_order": 1
}, - {
- "id": 2,
- "date": "2024-07-22",
- "cargo_booking_id": 3,
- "operational_vehicle_id": 3,
- "sort_order": 2
}
]
}配車登録を行うAPI
リクエストの 配車ID と 稼働車両ID が null の場合 >>登録しない
リクエストの 配車ID が null, 稼働車両ID が null ではない場合 >>登録
リクエストの 配車ID, 集荷ID, 稼働車両ID が null ではない場合 >>更新
リクエストの 配車ID が null ではなく、稼働車両ID が null の場合 >>削除
DB に表示時間より最新の更新日時が存在する場合 >> 400 を返却
DB に表示時間より最新の更新日時が存在しない場合 >> 登録
| Accept required | string Example: application/json |
required | Array of objects |
| opened_at required | string 表示時間 |
{- "vehicle_assignment_list": [
- {
- "date": "2024-07-22",
- "id": 1,
- "cargo_booking_id": 1,
- "operational_vehicle_id": 1,
- "sort_order": 1
}, - {
- "date": "2024-07-22",
- "id": 1,
- "cargo_booking_id": null,
- "operational_vehicle_id": 1,
- "sort_order": 2
}
], - "opened_at": "2024-07-29 10:00:00"
}{ }稼働車両の登録、削除を行うAPI
リクエストの車両ID に紐づくデータが DB に存在しなかった場合>>登録
リクエストに DB のデータに紐づく車両ID が存在しなかった場合>>削除
| Accept | string Example: application/json |
| date required | string <date> 稼働日 |
| vehicle_id required | Array of integers 車両IDリスト |
{- "date": "2024-07-25",
- "vehicle_id": [
- 1,
- 2,
- 3,
- 4,
- 5
]
}{ }稼働車両一覧取得を行うAPI
リクエストの日付から日数分の稼働車両を取得する
日数が指定されていない場合は、日付に紐づく稼働車両のみを取得
| date required | string <date> 日付 |
| number_of_days | integer 日数 |
| Accept required | string Example: application/json |
{- "operational_vehicle_list": [
- {
- "id": 1,
- "name": "車両A",
- "capacity_id": 1,
- "capacity": "大型",
- "vehicle_id": 1,
- "date": "2024-07-25"
}, - {
- "id": 2,
- "name": "車両B",
- "capacity_id": 2,
- "capacity": "中型",
- "vehicle_id": 2
}, - {
- "id": 3,
- "name": "車両C",
- "capacity_id": 1,
- "capacity": "大型",
- "vehicle_id": 3,
- "date": "2024-07-25"
}, - {
- "id": 4,
- "name": "車両D",
- "capacity_id": 2,
- "capacity": "中型",
- "operational_vehicle_id": 4,
- "date": "2024-07-25"
}, - {
- "id": 5,
- "name": "車両E",
- "capacity_id": 2,
- "capacity": "中型",
- "vehicle_id": 5,
- "date": "2024-07-25"
}, - {
- "id": 6,
- "name": "車両F",
- "capacity_id": 1,
- "capacity": "大型",
- "vehicle_id": 6,
- "date": "2024-07-25"
}
]
}{- "vehicle_list": [
- {
- "id": 1,
- "abbreviated_name": "自社",
- "name": "車両A",
- "capacity": "中型"
}, - {
- "id": 2,
- "abbreviated_name": "自社",
- "name": "車両B",
- "capacity": "大型"
}
]
}車両登録を行うAPI
| Accept required | string Example: application/json |
| carrier_id required | integer 依頼先業者ID |
| name required | string 車両名 |
| capacity_id required | integer 積載量ID |
{- "carrier_id": 1,
- "name": "車両X",
- "capacity_id": 1
}{ }id に紐づく、車両更新を行うAPI
| vehicle_id required | integer 車両ID |
| Accept required | string Example: application/json |
| carrier_id required | integer 依頼先業者ID |
| name required | string 車両名 |
| capacity_id required | integer 積載量ID |
{- "carrier_id": 1,
- "name": "車両X",
- "capacity_id": 1
}{ }{- "farmer_list": [
- {
- "id": 1,
- "name": "農家A",
- "name_kana": "のうかえー",
- "address": "青森県XXXXXXXXXXXX",
- "capacity": "中型",
- "travel_time": 30
}, - {
- "id": 2,
- "name": "農家B",
- "name_kana": "のうかびー",
- "address": "青森県XXXXXXXXXXXX",
- "capacity": "大型",
- "travel_time": 25
}
]
}生産者登録を行うAPI
| Accept required | string Example: application/json |
| farmer_code required | string 生産者コード |
| name required | string 生産者名 |
| name_kana required | string 生産者名(かな) |
| address_prefecture required | string 住所(都道府県) |
| address_city required | string 住所(地区町村) |
| address_block required | string 住所(番地以降) |
| address_latitude required | integer 住所(緯度) |
| address_longitude required | integer 住所(経度) |
| location_name | string or null 集荷先名称 |
| capacity_id required | integer 侵入可能車両 |
| travel_time required | integer 移動時間(分) |
{- "farmer_code": "1000",
- "name": "農家A",
- "name_kana": "のうかえー",
- "address_prefecture": "青森県",
- "address_city": "つがる市木造丸山竹鼻",
- "address_block": "in amet",
- "address_latitude": 11.1111,
- "address_longitude": 22.2222,
- "location_name": "ほげほげ",
- "capacity_id": 1,
- "travel_time": 30
}{ }id に紐づく、生産者更新を行うAPI
| farmer_id required | integer 生産者ID |
| Accept required | string Example: application/json |
| farmer_code required | string 生産者コード |
| name required | string 生産者名 |
| name_kana required | string 生産者名(かな) |
| address_prefecture required | string 住所(都道府県) |
| address_city required | string 住所(地区町村) |
| address_block required | string 住所(番地以降) |
| address_latitude required | integer 住所(緯度) |
| address_longitude required | integer 住所(経度) |
| location_name | string or null 集荷先名称 |
| capacity_id required | integer 侵入可能車両 |
| travel_time required | integer 移動時間(分) |
{- "farmer_code": "1000",
- "name": "農家A",
- "name_kana": "のうかえー",
- "address_prefecture": "青森県",
- "address_city": "つがる市木造丸山竹鼻",
- "address_block": "in amet",
- "address_latitude": 11.1111,
- "address_longitude": 22.2222,
- "location_name": "ふがふが",
- "capacity_id": 1,
- "travel_time": 30
}{ }id に紐づく、生産者詳細取得を行うAPI
| farmer_id required | integer 生産者ID |
| Accept required | string Example: application/json |
{- "id": 1,
- "name": "農家A",
- "name_kana": "のうかえー",
- "address_prefecture": "青森県",
- "address_city": "つがる市木造丸山竹鼻",
- "address_block": "118-5",
- "address_latitude": 11.1111,
- "address_longitude": 22.2222,
- "location_name": "ほげほげ",
- "capacity_id": 1,
- "travel_time": 30
}集荷依頼先業者一覧取得を行うAPI
| Accept required | string Example: application/json |
{- "carrier_list": [
- {
- "id": 1,
- "official_name": "サンライズ産業株式会社",
- "abbreviated_name": "サンライズ"
}, - {
- "id": 2,
- "official_name": "藤崎運輸有限会社",
- "abbreviated_name": "藤崎運輸(有)"
}
]
}集荷依頼先業者登録を行うAPI
| Accept required | string Example: application/json |
| official_name required | string 正式名称 |
| abbreviated_name required | string 略式 |
{- "official_name": "サンライズ産業株式会社",
- "abbreviated_name": "サンライズ"
}{ }id に紐づく、集荷依頼先業者更新を行うAPI
| carrier_id required | integer 集荷依頼先業者ID |
| Accept required | string Example: application/json |
| official_name required | string 正式名称 |
| abbreviated_name required | string 略式 |
{- "official_name": "サンライズ産業株式会社",
- "abbreviated_name": "サンライズ"
}{ }