| ... | ... | @@ -382,3 +382,72 @@ file data in base64 format |
|
|
|
</details>
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
### Add File
|
|
|
|
|
|
|
|
> Adds submission's file to file database (Minio).
|
|
|
|
|
|
|
|
| Method | Route | Content type | Authentication |
|
|
|
|
|--------|-------|--------------|----------------|
|
|
|
|
| POST | `/challenge/sendfile` | `application/json` | Bearer token |
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Required Body</b></summary>
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"challengeFile": "string (file data in base64)",
|
|
|
|
"taskId": "string"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
</details>
|
|
|
|
|
|
|
|
<details>
|
|
|
|
<summary><b>Example Responses</b></summary>
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
statusCode: 200,
|
|
|
|
message: "Challenge file was successfully received",
|
|
|
|
details: {
|
|
|
|
fileId: "string",
|
|
|
|
taskId: "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 403,
|
|
|
|
"error": "Image in review/approved",
|
|
|
|
"message": "Client has image in review or image is already approved",
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 403,
|
|
|
|
"error": "Challenge room is not active",
|
|
|
|
"message": `Challenge room is not active to receive challenge files`
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 415,
|
|
|
|
"error": "File type invalid",
|
|
|
|
"message": `Given file incorrect format |`
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"statusCode": 500,
|
|
|
|
"error": "Server error",
|
|
|
|
"message": "Error when sending file"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
</details>
|
|
|
|
|
|
|
|
--- |
|
|
\ No newline at end of file |