123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623 |
- name: Bimba API
- version-code: 0.1.0
- version-name: Agrajag
- status: draft
- formats: &formats
- msgpack: msgpack
- errors:
- _general: &_general-error
- error:
- type: str
- _fields: &_fields-error
- fields:
- required: false
- type: list
- items:
- type: dict
- items:
- field:
- type: str
- error:
- type: str
- error_general: &error_general
- type: dict
- items:
- *_general-error
- error_fields: &error_fields
- type: dict
- items:
- <<: *_general-error
- <<: *_fields-error
- api:
- -
- path: /timetables/
- GET:
- description: list of dates (from,to)
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- id:
- type: str
- start:
- type: str:RFC_3339_full-date
- end:
- type: str:RFC_3339_full-date
- POST:
- description: new timetable [locked]
- req:
- headers:
- - Accept
- - Authorization (Signature {signature})
- - Content-Type
- schema: todo
- res:
- codes:
- - 201
- - 400
- - 401
- - 403
- - 406
- - 409 # already exists for the period
- headers:
- - Allow
- - WWW-Authenticate
- - Content-Type
- - Location
- schema:
- *error_fields
- DELETE:
- description: remove timetable [locked]
- req:
- headers:
- - Accept
- - Authorization (Signature {signature})
- res:
- codes:
- - 204
- - 401
- - 403
- - 406
- - 410
- headers:
- - Allow
- - WWW-Authenticate
- - Content-Type
- schema:
- *error_general
- -
- path: /timetables/:date:(`current`|RFC_3339_full-date)
- GET:
- description: timetable valid in :date full with metadata
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema: todo
-
- -
- path: /timetables/:date/lines/
- GET:
- description:
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- name:
- type: str
- directions:
- type: list
- items:
- type: int
- -
- path: /timetables/:date/lines/:number?direction:(0|1)=null
- GET:
- description: line graph <filtered by direction>
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- direction: # (0|1)
- type: int
- components:
- type: list
- items:
- type: dict
- items:
- main:
- type: bool
- stops:
- type: list
- items:
- type: dict
- items:
- code:
- type: str
- name:
- type: str
-
- -
- path: /timetables/:date/stops/?q:query=''
- GET:
- description: list of stops matching latinised, case insensitive ^.*q.*$; sorted by relevance and limited to N=10?
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- name:
- type: str
- code:
- type: str
- lines:
- type: list
- items:
- type: str # {line} → {headsign}
- -
- path: /timetables/:date/stops/:name/sheds/
- reason: is neccessary?
-
- -
- path: /timetables/:date/stops/:name/sheds/:code
- reason: is neccessary?
- -
- path: /timetables/:date/departures/sheds/:code?metadata:bool=false # todo: metadata schema
- GET:
- description: departures for whole shed
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema: &departure
- type: list
- items:
- type: dict
- items:
- line:
- type: str
- headsign:
- type: str
- time:
- type: int # seconds after midnight
- modifications:
- type: list
- items:
- type: str
- accessible: # low floor
- type: bool
- -
- path: /timetables/:date/departures/sheds/:code/lines/:number?metadata:bool=false # todo: metadata schema
- GET:
- description: departures for whole line in shed
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- *departure
- -
- path: /timetables/:date/departures/sheds/:code/lines/:number/headsigns/:headsign?metadata:bool=false # todo: metadata schema
- GET:
- description: departures for whole line with headsign in shed
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- - 410 # past date
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- *departure
- -
- path: /information/(news|alerts)/
- GET:
- description: list of ID, title, source, date, translations, thumbnail
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- id:
- type: str
- title:
- type: str
- source:
- type: str # URL
- datetime:
- type: str # RFC3339
- translations:
- type: list
- items:
- type: str # IETF language tag
- thumbnail: # preferably webp
- type: bytes
- -
- path: /imformation/*/:id
- GET:
- description: original text of the piece of information
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: dict
- items:
- content:
- type: str # ReStructuredText?
- lang:
- type: str # IETF language tag
- -
- path: /information/*/:id/translations/
- GET:
- description: list of translations (ID, lang)
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- id:
- type: str
- lang:
- type: str # IETF language tag
- POST:
- description: create new translation
- req:
- headers:
- - Accept
- - Content-Type
- schema:
- type: dict
- items:
- content:
- type: str
- lang:
- type: str # IETF language tag
- res:
- codes:
- - 201
- - 400
- - 406
- headers:
- - Allow
- - Content-Type
- - Location
- schema:
- *error_fields
- -
- path: /information/*/:id/translations/:id
- GET:
- description: translations content and score
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: dict
- items:
- content:
- type: str
- lang:
- type: str # IETF language tag
- score:
- type: float
- PATCH:
- description: assess translation
- req:
- headers:
- - Accept
- - Content-Type
- schema:
- type: dict
- items:
- vote:
- type: float
- res:
- codes:
- - 200
- - 400
- - 404
- - 406
- headers:
- - Allow
- - Content-Type
- - Location
- schema:
- *error_fields
- -
- path: /crash_reports/
- GET:
- description: list of crash reports (date, id)
- formats:
- <<: *formats
- atom: atom
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: list
- items:
- type: dict
- items:
- id:
- type: str
- date:
- type: str # RFC3339
- POST:
- description: new crash report
- req:
- headers:
- - Accept
- - Content-Type
- schema:
- type: dict
- items: &crash_report
- app: # web,apk,…
- type: str
- app_version:
- type: str
- conetxt: # apk:OS, web:browser
- type: str
- context_version: # apk:Android API level (ROM?), web:browser version
- type: str
- device: # apk:make,model,…, web:?
- type: str
- content: # staktrace, &c.
- type: str
- res:
- codes:
- - 201
- - 400
- - 406
- headers:
- - Allow
- - Content-Type
- - Location
- schema:
- *error_fields
- -
- path: /crash_reports/:id
- GET:
- description: crash report
- req:
- headers:
- - Accept
- - If-None-Match
- res:
- codes:
- - 200
- - 304
- - 404
- - 406
- headers:
- - Allow
- - Content-Type
- - ETag
- schema:
- type: dict
- items:
- <<: *crash_report
- issue: # bug tracking issue (e.g. in repo)
- type: str # URL
- updated:
- type: str # RFC3339
- PATCH:
- description: add info [locked]
- req:
- headers:
- - Accept
- - Authorization (Signature {signature})
- - Content-Type
- - If-Match
- schema:
- type: dict
- items:
- issue: # bug tracking issue (e.g. in repo)
- type: str # URL
- res:
- codes:
- - 200
- - 400
- - 401
- - 403
- - 406
- - 412
- - 428
- headers:
- - Allow
- - WWW-Authenticate
- - Content-Type
- - Location
- schema:
- *error_fields
- DELETE:
- description: remove [locked]
- req:
- headers:
- - Accept
- - Authorization (Signature {signature})
- res:
- codes:
- - 204
- - 401
- - 403
- - 406
- - 410
- headers:
- - Allow
- - WWW-Authenticate
- - Content-Type
- schema:
- *error_general
|