Skip to content

Commit a70715b

Browse files
authored
Update agent-http-api.md
1 parent a5b95c9 commit a70715b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/agent-http-api.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ behave this way:
6060
* `POST /agent-api/complete-experiment` should be called as soon as the agent
6161
has nothing left to do with the current experiment; after the method returns
6262
`next-experiment` will return a new experiment
63+
* `POST /error` should be called only when the agent has encountered an error
6364

6465
## Available endpoints
6566

@@ -227,3 +228,26 @@ The endpoint replies with `true`.
227228
"result": true
228229
}
229230
```
231+
232+
### `POST /error`
233+
234+
This endpoint tells the Crater server the agent has encountered an error. The endpoint expects the error description to be provided as the request body, encoded in JSON:
235+
236+
* `error`: a description of the error
237+
238+
For example, this is a valid request data:
239+
240+
```json
241+
{
242+
"error": "pc is not powered on"
243+
}
244+
```
245+
246+
The endpoint replies with `true`.
247+
248+
```json
249+
{
250+
"status": "success",
251+
"result": true
252+
}
253+
```

0 commit comments

Comments
 (0)