Add export_file documentation

This commit is contained in:
Sven Seeberg 2020-10-29 13:45:39 +01:00
parent 76ee2fdd9e
commit 6b4ef48d9a
Signed by: sven.seeberg
GPG key ID: 29559DD5A83806B5

View file

@ -9,7 +9,7 @@ Retrieve hashes / vote IDs for a list of user names and a known event.
### REQUEST
Request Headers - endpoint requires SSL client certificate
```http
GET /get_ids HTTP/1.1
POST /get_ids HTTP/1.1
Host: abstimmidd.netzbegruenung.de
Content-Type: application/json
```
@ -36,24 +36,60 @@ Request Body
]
```
## Register event
Creates an event for which hashes can be generated and retrieved. The event token should be regarded a secret.
### REQUEST
Request Headers - endpoint requires SSL client certificate
```http
GET /register_event HTTP/1.1
POST /register_event HTTP/1.1
Host: abstimmidd.netzbegruenung.de
Content-Type: application/json
```
Request Body
```javascript
{
"event_token": String // Secret event token to identify event
"event_token": String // Secret event token to identify event
}
```
### RESPONSE
```javascript
[
"success": Bool // Registration of event was successful
]
{
"success": Bool // Registration of event was successful
}
```
## Create result export
Create a signed file that is publicly accessible to validate the result. The SHA256 hash of the result file and the signing key ID are returned.
### REQUEST
Request Headers - endpoint requires SSL client certificate
```http
POST /export_result HTTP/1.1
Host: abstimmidd.netzbegruenung.de
Content-Type: application/json
```
Request Body
```javascript
{
"event_token": String, // Secret event token to identify event
"event_title": String, // used in export file name
"vote_round": int, // nth vote round
"votes": [
{ "hash": VOTE_ID, "vote":
[
String, // Description of vote (against, for, abstinence, name of nominee, etc)
[...] // repeat if multiple votes are possible
]
},
[...] // repeat for each voter
]
}
```
### RESPONSE
```javascript
{
"success": Bool, // Registration of event was successful
"file_hash": Str, // SHA256 hash of generated result file
"signing_key_id": Str // ID of key used to sign result file
}
```
# Pre-generate vote IDs