Back to top

RailApi

Resource Group

線路データ作成

線路データ取得
POST/rail/index

乗車駅と降車駅をもとに線路データを取得します。

Example URI

POST /rail/index
Request
HideShow
Headers
Content-Type: application/json
Body
{
  "line_id": 1000,
  "start": 1,
  "end": 2
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "line_id": {
      "type": "number",
      "description": "路線Id"
    },
    "start": {
      "type": "number",
      "description": "乗車駅のstation_id"
    },
    "end": {
      "type": "number",
      "description": "降車駅のstation_id"
    }
  },
  "required": [
    "line_id",
    "start",
    "end"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "id": 1,
  "line_id": 2,
  "data": "\"[[139.77818, 35.62961], [139.77888, 35.63]]\"",
  "order": 10,
  "is_station": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "線路データ(rail) の id"
    },
    "line_id": {
      "type": "number",
      "description": "路線データ(line) の id"
    },
    "data": {
      "type": "string",
      "description": "線路データ"
    },
    "order": {
      "type": "number",
      "description": "路線内での線路の順番"
    },
    "is_station": {
      "type": "boolean",
      "description": "その線路データが駅の座標か"
    }
  },
  "required": [
    "id",
    "line_id",
    "data",
    "order",
    "is_station"
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "message": "error message"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "エラーに合わせてメッセージを返す"
    }
  },
  "required": [
    "message"
  ]
}

Generated by aglio on 10 Dec 2017