45 lines
1009 B
Markdown
45 lines
1009 B
Markdown
# WebAPI
|
|
Simple web application created using DTLib.Web.
|
|
|
|
|
|
## Important
|
|
Restart web application once per day to delete outdated data and clean RAM.
|
|
|
|
## Routes
|
|
### POST `/uploadSave`
|
|
- **Query Params:**
|
|
- `game` - short name of the game (see [../README.md](../README.md))
|
|
- **Request Body:** `application/octet-stream` - .eu4 file
|
|
- **Response:**
|
|
```json
|
|
{ "saveId": "string" }
|
|
```
|
|
or `{ "errorMessage": "string" }`
|
|
|
|
### GET `/getSaveStatus`
|
|
- **Query Params:**
|
|
- `id` - id of uploaded save file
|
|
- **Response:** [SaveFileMetadata](./SaveFileMetadata.cs)
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"game": "string",
|
|
"status": "string",
|
|
"errorMessage": "string?"
|
|
}
|
|
```
|
|
|
|
### GET `/getSaveData`
|
|
- **Query Params:**
|
|
- `id` - id of uploaded save file
|
|
- **Response:**
|
|
```json5
|
|
{
|
|
"key0": [ "objects" ],
|
|
"key1": [ "objects" ],
|
|
//...
|
|
}
|
|
```
|
|
or `{ "errorMessage": "string" }`
|
|
|