Skip to content
Soulou edited this page Jun 4, 2012 · 5 revisions

Toute les urls données dans ce documents doivent être précédées du préfix /api.

Ships

Get all ships

GET /ships

Response example

[
  {
    id: "4f8d27adb04b990007000001",
    name: "Queen Mary 2",
    position: [10.1, 12.3]
    operator: {
      id: "4fb22e3a86272630b5000010",
      name: "English Factice Corp"
    },
    ship_class: {
      id: "4fb22e3a86272630b5000006",
      name: "Cat. 1"
    }
  },
  {
    id: "4f8d2856b04b990007000002",
    name: "Titanic",
    position: [10.4, 15.2]
    operator: {
      id: "4fb22e3a86272630b5000010",
      name: "Factice Corp"
    },
    ship_class: {
      id: "4fb22e3a86272630b5000006",
      name: "Cat. 1"
    }
  }
]

Get a precise ship

GET /ships/:id

GET /ships/4f8d27adb04b990007000001

Response example

{
  id": "4f8d27adb04b990007000001",
  name": "Queen Mary 2",
  position": [12.1, 9.2]
  operator: {
    id: "4fb22e3a86272630b5000010",
    name: "English Factice Corp"
  },
  ship_class: {
    id: "4fb22e3a86272630b5000007",
    name: "Cat. 2"
  }
  registrations: [
    {
      id: "4fc61bca8627261959000009",
      slice: 1
      date: "2012-05-30T00:00:00+02:00",
      location_id: "4f8c07f28627261068000004"
    },
    {
      id: "4fc61bca8627261959000010",
      slice: 2
      date: "2012-05-30T00:00:00+02:00",
      location_id: "4f8c07f28627261068000005"
    }
  ]
}

Get a precise ship reservations

GET /ships/:id/reservations

GET /ships/4f8d27adb04b990007000001/reservations

Response example

[
  {
    id: "4fc61bca8627261959000009",
    slice: 1
    date: "2012-05-30T00:00:00+02:00",
    location_id: "4f8c07f28627261068000004"
  },
  {
    id: "4fc61bca8627261959000010",
    slice: 2
    date: "2012-05-30T00:00:00+02:00",
    location_id: "4f8c07f28627261068000005"
  }
]
Clone this wiki locally