Skip to content

Commit 708e84b

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

File tree

1 file changed

+39
-7
lines changed

1 file changed

+39
-7
lines changed

README.md

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
1-
# Merch Embedded
1+
# Merch Embedded
2+
3+
This repository contains all of the code related to controlling the underlying merch hardware (the vending machine).
4+
Merch runs an embedded webserver that can be accessed at merch.acm.illinois.edu.
5+
6+
## API
7+
8+
### Vend a location
9+
To vend a list of items, POST a request to /vend.
10+
The request is of the form
11+
```json
12+
{
13+
"transaction_id": 1,
14+
"items": ["A1", "B2", "C3"]
15+
}
16+
```
17+
18+
The machine will respond with
19+
```json
20+
{
21+
"transaction_id": 1,
22+
"items": [
23+
{"location": "A1", "error": null},
24+
{"location": "B2", "error": "some sort of error"},
25+
{"location": "C3", "error": null},
26+
27+
]
28+
}
29+
```
30+
31+
The errors that can take place while vending are currently:
32+
* `"Invalid location"`
233

334

435
[![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)
536

6-
Possible information sources:
37+
## Some related datasheets
38+
739
[http://bajavending.com/Manual-de-Operacion-BevMax.pdf](http://bajavending.com/Manual-de-Operacion-BevMax.pdf)
840
* Has the right picture of the main controller board, no programming information though
941

@@ -18,15 +50,15 @@ has some useful info about what commands are sent
1850

1951
## License
2052

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.
53+
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.
2254

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

2557
```
2658
Copyright © 2017, ACM@UIUC
2759
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.
60+
This file is part of the Merch Project.
61+
62+
The Merch Project is open source software, released under the University of Illinois/NCSA Open Source License.
3163
You should have received a copy of this license in a file with the distribution.
3264
```

0 commit comments

Comments
 (0)