-
Notifications
You must be signed in to change notification settings - Fork 1
API documentation
MarPiRK edited this page Apr 15, 2015
·
4 revisions
Documentation of API. Description of possible attributes and outcomes.
Documentation current API version: 0.0.1
On the output is XML file with module-specific or general purpose tags.
All modules in this documentation have following format:
text description
| Attribute | Description | Values |
|---|---|---|
attr |
desc |
possible values |
| Tag | Description | Body | Attributes |
|---|---|---|---|
tag |
desc |
body |
attr |
| Id | Name | Description | Attributes |
|---|---|---|---|
id |
name |
desc |
attr |
It is used for all modules.
| Attribute | Description | Values |
|---|---|---|
| client | Client name | android |
| version | Version number of client | Version number or beta – then API doesn't care about compatibility. |
| module | Module name | lucky |
| Tag | Description | Body | Attributes |
|---|---|---|---|
| api | Generic API info |
version – API version number |
|
| error | Message of thrown error | Error message |
name – error nameEvery error has also its own attributes (see Errors section). |
| Id | Name | Description | Attributes |
|---|---|---|---|
| 1 | runtime | Runtime error, which should not pop out! Create issue if you see this error | These attributes are not mandatory:error_id – id of error, with witch was problemproblem_attrib – attribute, with which was problem |
| 2 | db | Database error with mysql message as body |
db_errno – mysql's error number |
| 3 | parse | Some kind of parse error | |
| 4 | noAttr | Attribute not found |
attribute – attribute, which was not found |
| 5 | attrNotValid | Attribute is not valid (for invalid format – parse error) |
attribute – attribute, which is invalidvalid (not mandatory) – the best value of this attribute |
| 6 | nothing | Nothing to show |
name – what exactly should be shown |
Lucky numbers are in Polish Szczęśliwe Numerki. Every school day at the beginning of day two numbers are ruffled. People with those numbers in class register, cannot be asked during lessons.
| Attribute | Description | Values |
|---|
range | Return numbers from range of dates (see date attributes below) | `0` or `1`
date | If `range` is `0` returns numbers of specific day, otherwise range is from that date until today | Date in format `Y-m-d`
date1
date2 | Only applicable if range is 1 – date1 is range beginning date and date2 is ending date | Date in format Y-m-d
| Tag | Description | Body | Attributes |
|---|---|---|---|
| lucky | Lucky numbers | Array of integers divided by ,
|
date – lucky number date |
| Id | Name | Description | Attributes |
|---|---|---|---|
| 3 | parse | Thrown when date format is not valid |
wrong – wrong date stringvalid – valid date format |