Skip to content

Commit 13dea4d

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

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

README.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
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+
Every request through the API has a token in the header that is unique to groot.
12+
This way, only groot can make requests to vend things.
13+
The token is stored in the request header.
14+
15+
### Vend a location
16+
To vend a list of items, POST a request to `/vend`.
17+
The request is of the form
18+
```json
19+
{
20+
"transaction_id": 1,
21+
"items": ["A1", "B2", "C3"]
22+
}
23+
```
24+
25+
The machine will respond with
26+
```json
27+
{
28+
"transaction_id": 1,
29+
"items": [
30+
{"location": "A1", "error": null},
31+
{"location": "B2", "error": "some sort of error"},
32+
{"location": "C3", "error": null},
33+
34+
]
35+
}
36+
```
37+
38+
The errors that can take place while vending are currently:
39+
* `"Invalid location"`
40+
41+
42+
## Some related datasheets
43+
744
[http://bajavending.com/Manual-de-Operacion-BevMax.pdf](http://bajavending.com/Manual-de-Operacion-BevMax.pdf)
845
* Has the right picture of the main controller board, no programming information though
946

@@ -18,15 +55,15 @@ has some useful info about what commands are sent
1855

1956
## License
2057

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.
58+
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.
2259

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

2562
```
2663
Copyright © 2017, ACM@UIUC
2764
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.
65+
This file is part of the Merch Project.
66+
67+
The Merch Project is open source software, released under the University of Illinois/NCSA Open Source License.
3168
You should have received a copy of this license in a file with the distribution.
3269
```

0 commit comments

Comments
 (0)