bb8150d420bbcbb05d70c61e0c6c1a531f8f0372.svn-base 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <!DOCTYPE HTML><html><head><title>Booking API documentation</title><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="generator" content="https://github.com/kevinrenskers/raml2html 2.2.0"><link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/styles/default.min.css"><script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.min.js"></script><script type="text/javascript" src="https://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.1/highlight.min.js"></script><script type="text/javascript">
  2. $(document).ready(function() {
  3. $('.page-header pre code, .top-resource-description pre code').each(function(i, block) {
  4. hljs.highlightBlock(block);
  5. });
  6. $('[data-toggle]').click(function() {
  7. var selector = $(this).data('target') + ' pre code';
  8. $(selector).each(function(i, block) {
  9. hljs.highlightBlock(block);
  10. });
  11. });
  12. // open modal on hashes like #_action_get
  13. $(window).bind('hashchange', function(e) {
  14. var anchor_id = document.location.hash.substr(1); //strip #
  15. var element = $('#' + anchor_id);
  16. // do we have such element + is it a modal? --> show it
  17. if (element.length && element.hasClass('modal')) {
  18. element.modal('show');
  19. }
  20. });
  21. // execute hashchange on first page load
  22. $(window).trigger('hashchange');
  23. // remove url fragment on modal hide
  24. $('.modal').on('hidden.bs.modal', function() {
  25. try {
  26. if (history && history.replaceState) {
  27. history.replaceState({}, '', '#');
  28. }
  29. } catch(e) {}
  30. });
  31. });
  32. </script><style>
  33. .hljs {
  34. background: transparent;
  35. }
  36. .parent {
  37. color: #999;
  38. }
  39. .list-group-item > .badge {
  40. float: none;
  41. margin-right: 6px;
  42. }
  43. .panel-title > .methods {
  44. float: right;
  45. }
  46. .badge {
  47. border-radius: 0;
  48. text-transform: uppercase;
  49. width: 70px;
  50. font-weight: normal;
  51. color: #f3f3f6;
  52. line-height: normal;
  53. }
  54. .badge_get {
  55. background-color: #63a8e2;
  56. }
  57. .badge_post {
  58. background-color: #6cbd7d;
  59. }
  60. .badge_put {
  61. background-color: #22bac4;
  62. }
  63. .badge_delete {
  64. background-color: #d26460;
  65. }
  66. .badge_patch {
  67. background-color: #ccc444;
  68. }
  69. .list-group, .panel-group {
  70. margin-bottom: 0;
  71. }
  72. .panel-group .panel+.panel-white {
  73. margin-top: 0;
  74. }
  75. .panel-group .panel-white {
  76. border-bottom: 1px solid #F5F5F5;
  77. border-radius: 0;
  78. }
  79. .panel-white:last-child {
  80. border-bottom-color: white;
  81. -webkit-box-shadow: none;
  82. box-shadow: none;
  83. }
  84. .panel-white .panel-heading {
  85. background: white;
  86. }
  87. .tab-pane ul {
  88. padding-left: 2em;
  89. }
  90. .tab-pane h2 {
  91. font-size: 1.2em;
  92. padding-bottom: 4px;
  93. border-bottom: 1px solid #ddd;
  94. }
  95. .tab-pane h3 {
  96. font-size: 1.1em;
  97. }
  98. .tab-content {
  99. border-left: 1px solid #ddd;
  100. border-right: 1px solid #ddd;
  101. border-bottom: 1px solid #ddd;
  102. padding: 10px;
  103. }
  104. #sidebar {
  105. margin-top: 30px;
  106. padding-right: 5px;
  107. overflow: auto;
  108. height: 90%;
  109. }
  110. .top-resource-description {
  111. border-bottom: 1px solid #ddd;
  112. background: #fcfcfc;
  113. padding: 15px 15px 0 15px;
  114. margin: -15px -15px 10px -15px;
  115. }
  116. .resource-description {
  117. border-bottom: 1px solid #fcfcfc;
  118. background: #fcfcfc;
  119. padding: 15px 15px 0 15px;
  120. margin: -15px -15px 10px -15px;
  121. }
  122. .resource-description p:last-child {
  123. margin: 0;
  124. }
  125. .list-group .badge {
  126. float: left;
  127. }
  128. .method_description {
  129. margin-left: 85px;
  130. }
  131. .method_description p:last-child {
  132. margin: 0;
  133. }
  134. .list-group-item {
  135. cursor: pointer;
  136. }
  137. .list-group-item:hover {
  138. background-color: #f5f5f5;
  139. }
  140. </style></head><body data-spy="scroll" data-target="#sidebar"><div class="container"><div class="row"><div class="col-md-9" role="main"><div class="page-header"><h1>Booking API documentation <small>version v1</small></h1><p>http://dddsample.marcusoncode.se/booking/v1</p></div><div class="panel panel-default"><div class="panel-heading"><h3 id="cargos" class="panel-title">/cargos</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_cargos"><span class="parent"></span>/cargos</a> <span class="methods"><a href="#cargos_get"><span class="badge badge_get">get</span></a> <a href="#cargos_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_cargos" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#cargos_get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>All booked cargos</p></div><div class="clearfix"></div></div><div onclick="window.location.href = '#cargos_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"><p>Book a new cargo.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos_get"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent"></span>/cargos</h4></div><div class="modal-body"><div class="alert alert-info"><p>All booked cargos</p></div><ul class="nav nav-tabs"><li><a href="#cargos_get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane" id="cargos_get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  141. "cargos": [
  142. {
  143. "arrival_deadline": "0001-01-01T00:00:00Z",
  144. "destination": "CNHKG",
  145. "misrouted": false,
  146. "origin": "SESTO",
  147. "routed": false,
  148. "tracking_id": "ABC123"
  149. },
  150. {
  151. "arrival_deadline": "0001-01-01T00:00:00Z",
  152. "destination": "SESTO",
  153. "misrouted": false,
  154. "origin": "AUMEL",
  155. "routed": false,
  156. "tracking_id": "FTL456"
  157. }
  158. ]
  159. }
  160. </code></pre></div></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos_post"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent"></span>/cargos</h4></div><div class="modal-body"><div class="alert alert-info"><p>Book a new cargo.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#cargos_post_request" data-toggle="tab">Request</a></li><li><a href="#cargos_post_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane active" id="cargos_post_request"><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  161. "origin": "SESTO",
  162. "destination": "DEHAM",
  163. "arrival_deadline": "2016-03-24T23:00:00Z"
  164. }
  165. </code></pre></div><div class="tab-pane" id="cargos_post_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  166. "tracking_id": "ABC123"
  167. }
  168. </code></pre></div></div></div></div></div></div></div><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_cargos__trackingId_"><span class="parent">/cargos</span>/{trackingId}</a> <span class="methods"><a href="#cargos__trackingId__get"><span class="badge badge_get">get</span></a></span></h4></div><div id="panel_cargos__trackingId_" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#cargos__trackingId__get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>A specific cargo</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos__trackingId__get"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent">/cargos</span>/{trackingId}</h4></div><div class="modal-body"><div class="alert alert-info"><p>A specific cargo</p></div><ul class="nav nav-tabs"><li class="active"><a href="#cargos__trackingId__get_request" data-toggle="tab">Request</a></li><li><a href="#cargos__trackingId__get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane active" id="cargos__trackingId__get_request"><h3>URI Parameters</h3><ul><li><strong>trackingId</strong>: <em>required (string)</em><p>The tracking id of the cargo</p></li></ul></div><div class="tab-pane" id="cargos__trackingId__get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  169. "cargo": {
  170. "arrival_deadline": "2016-03-30T22:00:00Z",
  171. "destination": "DEHAM",
  172. "legs": [
  173. {
  174. "voyage_number": "0300A",
  175. "from": "CNHKG",
  176. "to": "SESTO",
  177. "load_time": "2016-03-06T18:12:11.01579612Z",
  178. "unload_time": "2016-03-08T02:13:11.01579612Z"
  179. },
  180. {
  181. "voyage_number": "0400S",
  182. "from": "SESTO",
  183. "to": "FIHEL",
  184. "load_time": "2016-03-10T01:42:11.01579612Z",
  185. "unload_time": "2016-03-11T04:21:11.01579612Z"
  186. },
  187. {
  188. "voyage_number": "0100S",
  189. "from": "FIHEL",
  190. "to": "NLRTM",
  191. "load_time": "2016-03-13T08:42:11.01579612Z",
  192. "unload_time": "2016-03-14T01:38:11.01579612Z"
  193. }
  194. ],
  195. "misrouted": true,
  196. "origin": "CNHKG",
  197. "routed": true,
  198. "tracking_id": "D0909E1C"
  199. }
  200. }
  201. </code></pre></div></div></div></div></div></div></div><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_cargos__trackingId__assign_to_route"><span class="parent">/cargos/{trackingId}</span>/assign_to_route</a> <span class="methods"><a href="#cargos__trackingId__assign_to_route_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_cargos__trackingId__assign_to_route" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#cargos__trackingId__assign_to_route_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"><p>Assign given route to the cargo.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos__trackingId__assign_to_route_post"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/cargos/{trackingId}</span>/assign_to_route</h4></div><div class="modal-body"><div class="alert alert-info"><p>Assign given route to the cargo.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#cargos__trackingId__assign_to_route_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="cargos__trackingId__assign_to_route_post_request"><h3>URI Parameters</h3><ul><li><strong>trackingId</strong>: <em>required (string)</em><p>The tracking id of the cargo</p></li></ul><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  202. "legs": [
  203. {
  204. "voyage_number": "0301S",
  205. "from": "SESTO",
  206. "to": "FIHEL",
  207. "load_time": "2015-11-14T14:10:29.173391809Z",
  208. "unload_time": "2015-11-15T21:55:29.173391809Z"
  209. },
  210. {
  211. "voyage_number": "0100S",
  212. "from": "FIHEL",
  213. "to": "CNHKG",
  214. "load_time": "2015-11-18T02:19:29.173391809Z",
  215. "unload_time": "2015-11-19T04:11:29.173391809Z"
  216. }
  217. ]
  218. }
  219. </code></pre></div></div></div></div></div></div></div><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_cargos__trackingId__change_destination"><span class="parent">/cargos/{trackingId}</span>/change_destination</a> <span class="methods"><a href="#cargos__trackingId__change_destination_post"><span class="badge badge_post">post</span></a></span></h4></div><div id="panel_cargos__trackingId__change_destination" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#cargos__trackingId__change_destination_post'" class="list-group-item"><span class="badge badge_post">post</span><div class="method_description"><p>Change destination of the cargo. May result in a misrouted cargo.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos__trackingId__change_destination_post"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_post">post</span> <span class="parent">/cargos/{trackingId}</span>/change_destination</h4></div><div class="modal-body"><div class="alert alert-info"><p>Change destination of the cargo. May result in a misrouted cargo.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#cargos__trackingId__change_destination_post_request" data-toggle="tab">Request</a></li></ul><div class="tab-content"><div class="tab-pane active" id="cargos__trackingId__change_destination_post_request"><h3>URI Parameters</h3><ul><li><strong>trackingId</strong>: <em>required (string)</em><p>The tracking id of the cargo</p></li></ul><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  220. "destination": "CNHKG"
  221. }
  222. </code></pre></div></div></div></div></div></div></div><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_cargos__trackingId__request_routes"><span class="parent">/cargos/{trackingId}</span>/request_routes</a> <span class="methods"><a href="#cargos__trackingId__request_routes_get"><span class="badge badge_get">get</span></a></span></h4></div><div id="panel_cargos__trackingId__request_routes" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#cargos__trackingId__request_routes_get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>Requests routes based on current specification. Uses an external routing service provided by the routing package.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="cargos__trackingId__request_routes_get"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent">/cargos/{trackingId}</span>/request_routes</h4></div><div class="modal-body"><div class="alert alert-info"><p>Requests routes based on current specification. Uses an external routing service provided by the routing package.</p></div><ul class="nav nav-tabs"><li class="active"><a href="#cargos__trackingId__request_routes_get_request" data-toggle="tab">Request</a></li><li><a href="#cargos__trackingId__request_routes_get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane active" id="cargos__trackingId__request_routes_get_request"><h3>URI Parameters</h3><ul><li><strong>trackingId</strong>: <em>required (string)</em><p>The tracking id of the cargo</p></li></ul></div><div class="tab-pane" id="cargos__trackingId__request_routes_get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  223. "routes": [
  224. {
  225. "legs": [
  226. {
  227. "voyage_number": "0301S",
  228. "from": "SESTO",
  229. "to": "FIHEL",
  230. "load_time": "2015-11-14T14:10:29.173391809Z",
  231. "unload_time": "2015-11-15T21:55:29.173391809Z"
  232. },
  233. {
  234. "voyage_number": "0100S",
  235. "from": "FIHEL",
  236. "to": "CNHKG",
  237. "load_time": "2015-11-18T02:19:29.173391809Z",
  238. "unload_time": "2015-11-19T04:11:29.173391809Z"
  239. }
  240. ]
  241. },
  242. {
  243. "legs": [
  244. {
  245. "voyage_number": "0400S",
  246. "from": "SESTO",
  247. "to": "JNTKO",
  248. "load_time": "2015-11-14T06:22:29.173415471Z",
  249. "unload_time": "2015-11-15T10:22:29.173415471Z"
  250. },
  251. {
  252. "voyage_number": "0200T",
  253. "from": "JNTKO",
  254. "to": "CNHKG",
  255. "load_time": "2015-11-17T10:45:29.173415471Z",
  256. "unload_time": "2015-11-18T11:48:29.173415471Z"
  257. }
  258. ]
  259. }
  260. ]
  261. }
  262. </code></pre></div></div></div></div></div></div></div></div></div></div><div class="panel panel-default"><div class="panel-heading"><h3 id="locations" class="panel-title">/locations</h3></div><div class="panel-body"><div class="panel-group"><div class="panel panel-white"><div class="panel-heading"><h4 class="panel-title"><a class="collapsed" data-toggle="collapse" href="#panel_locations"><span class="parent"></span>/locations</a> <span class="methods"><a href="#locations_get"><span class="badge badge_get">get</span></a></span></h4></div><div id="panel_locations" class="panel-collapse collapse"><div class="panel-body"><div class="list-group"><div onclick="window.location.href = '#locations_get'" class="list-group-item"><span class="badge badge_get">get</span><div class="method_description"><p>All registered locations.</p></div><div class="clearfix"></div></div></div></div></div><div class="modal fade" tabindex="0" id="locations_get"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button><h4 class="modal-title" id="myModalLabel"><span class="badge badge_get">get</span> <span class="parent"></span>/locations</h4></div><div class="modal-body"><div class="alert alert-info"><p>All registered locations.</p></div><ul class="nav nav-tabs"><li><a href="#locations_get_response" data-toggle="tab">Response</a></li></ul><div class="tab-content"><div class="tab-pane" id="locations_get_response"><h2>HTTP status code <a href="http://httpstatus.es/200" target="_blank">200</a></h2><h3>Body</h3><p><strong>Type: application/json</strong></p><p><strong>Example</strong>:</p><pre><code>{
  263. "locations": [
  264. {
  265. "locode": "DEHAM",
  266. "name": "Hamburg"
  267. },
  268. {
  269. "locode": "SESTO",
  270. "name": "Stockholm"
  271. },
  272. {
  273. "locode": "AUMEL",
  274. "name": "Melbourne"
  275. },
  276. {
  277. "locode": "CNHKG",
  278. "name": "Hongkong"
  279. },
  280. {
  281. "locode": "JNTKO",
  282. "name": "Tokyo"
  283. },
  284. {
  285. "locode": "NLRTM",
  286. "name": "Rotterdam"
  287. }
  288. ]
  289. }
  290. </code></pre></div></div></div></div></div></div></div></div></div></div></div><div class="col-md-3"><div id="sidebar" class="hidden-print affix" role="complementary"><ul class="nav nav-pills nav-stacked"><li><a href="#cargos">/cargos</a></li><li><a href="#locations">/locations</a></li></ul></div></div></div></div></body></html>