Skip to content

Commit a495a56

Browse files
committed
Update README with API documentation
1 parent dac83a8 commit a495a56

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

README.md

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
1-
# Merch Embedded
2-
1+
# Merch Embedded
32

43
[![Join the chat at https://gitter.im/acm-uiuc/merch-development](https://badges.gitter.im/acm-uiuc/merch-development.svg)](https://gitter.im/acm-uiuc/merch-development?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
54

6-
Possible information sources:
5+
6+
This repository contains all of the code related to controlling the underlying merch hardware (the vending machine).
7+
Merch runs an embedded webserver that can be accessed at merch.acm.illinois.edu.
8+
9+
## API
10+
11+
### Vend a location
12+
To vend a list of items, POST a request to /vend.
13+
The request is of the form
14+
```json
15+
{
16+
"transaction_id": 1,
17+
"items": ["A1", "B2", "C3"]
18+
}
19+
```
20+
21+
The machine will respond with
22+
```json
23+
{
24+
"transaction_id": 1,
25+
"items": [
26+
{"location": "A1", "error": null},
27+
{"location": "B2", "error": "some sort of error"},
28+
{"location": "C3", "error": null},
29+
30+
]
31+
}
32+
```
33+
34+
The errors that can take place while vending are currently:
35+
* `"Invalid location"`
36+
37+
38+
## Some related datasheets
39+
740
[http://bajavending.com/Manual-de-Operacion-BevMax.pdf](http://bajavending.com/Manual-de-Operacion-BevMax.pdf)
841
* Has the right picture of the main controller board, no programming information though
942

@@ -18,15 +51,15 @@ has some useful info about what commands are sent
1851

1952
## License
2053

21-
This project is licensed under the University of Illinois/NCSA Open Source License. For a full copy of this license take a look at the LICENSE file.
54+
This project is licensed under the University of Illinois/NCSA Open Source License. For a full copy of this license take a look at the LICENSE file.
2255

23-
When contributing new files to this project, preappend the following header to the file as a comment:
56+
When contributing new files to this project, preappend the following header to the file as a comment:
2457

2558
```
2659
Copyright © 2017, ACM@UIUC
2760
28-
This file is part of the Merch Project.
29-
30-
The Merch Project is open source software, released under the University of Illinois/NCSA Open Source License.
61+
This file is part of the Merch Project.
62+
63+
The Merch Project is open source software, released under the University of Illinois/NCSA Open Source License.
3164
You should have received a copy of this license in a file with the distribution.
3265
```

0 commit comments

Comments
 (0)