This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
api-trucks-for-you [2018/08/02 10:50] hari [Request] |
api-trucks-for-you [2018/08/02 10:57] hari [Response if request is successful] |
||
---|---|---|---|
Line 1060: | Line 1060: | ||
Body | Body | ||
<code> | <code> | ||
+ | [ | ||
+ | { | ||
+ | "id": "uuid-of-trip", | ||
+ | "truck": { | ||
+ | "id": "uuid-of-truck", | ||
+ | "registration": "registration-number" | ||
+ | }, | ||
+ | "source":{ | ||
+ | "date": "YYYY-MM-DD, date when truck leaves source", | ||
+ | "city": { | ||
+ | "id": "uuid-of-city", | ||
+ | "name": "name-of-city" | ||
+ | }, | ||
+ | }, | ||
+ | "destination": { | ||
+ | "date": "YYYY-MM-DD, date when truck reaches destination", | ||
+ | "city": { | ||
+ | "id": "uuid-of-city", | ||
+ | "name": "name-of-city" | ||
+ | } | ||
+ | } | ||
+ | }, | ||
+ | { ... more trips ... } | ||
+ | ] | ||
</code> | </code> | ||
- | ==== Response if token is invalid ==== | + | ==== Response when request is successful, but there are no trips ==== |
Headers | Headers | ||
<code> | <code> | ||
- | HTTP/1.1 401 INVALID-TOKEN | + | HTTP/1.1 204 DONE |
</code> | </code> | ||
- | ==== Response if forbidden ==== | + | ==== Response if token is invalid ==== |
Headers | Headers | ||
<code> | <code> | ||
- | HTTP/1.1 403 FORBIDDEN | + | HTTP/1.1 401 INVALID-TOKEN |
</code> | </code> | ||
- | ==== Response if fields are missing or invalid ==== | + | ==== Response if forbidden ==== |
Headers | Headers | ||
<code> | <code> | ||
- | HTTP/1.1 400 INVALID-<field-name> | + | HTTP/1.1 403 FORBIDDEN |
- | Content-Type: text/plain | + | |
</code> | </code> | ||
- | Body | ||
- | <code> | ||
- | Validation error specific to the error in the field | ||
- | </code> | ||
- | ==== Response if underlying objects don't exist ==== | ||
- | |||
- | Headers | ||
- | <code> | ||
- | HTTP/1.1 404 <object-type>-NOT-FOUND | ||
- | </code> | ||
==== Response for any other error ==== | ==== Response for any other error ==== |