-
Notifications
You must be signed in to change notification settings - Fork 9
Sentry
Zijun Chen edited this page Mar 29, 2019
·
3 revisions
request a full page screenshot
| Method | Path | Auth |
|---|---|---|
| POST | v1/sentry/request_full_screenshot | User |
Request Parameters
| Parameter | Type | Optional | Data Type | Description |
|---|---|---|---|---|
| url | Query String | - | String | The url of the target page |
v1/sentry/request_full_screenshot?url=https://www.google.com/
Possible Error Codes
| Error Code | Description | Note |
|---|---|---|
| -2 | Wrong parameter | Wrong protocol (http\https only) |
Success Example
{
"code": 0,
"msg": "OK",
"data": {
"taskId": 430822103
}
}wait for the given full screenshot task to be finished
this is a long polling request
| Method | Path | Auth |
|---|---|---|
| POST | v1/sentry/wait_full_screenshot | User |
Request Parameters
| Parameter | Type | Optional | Data Type | Description |
|---|---|---|---|---|
| taskId | Query String | - | Integer | Task ID |
v1/sentry/wait_full_screenshot?taskId=430822103
Possible Error Codes
| Error Code | Description | Note |
|---|---|---|
| -2 | Wrong parameter | - |
| -5 | Record does not exist | - |
Success Example
the task is successfully completed only if the feedbackCode == 1
use get-full-screenshot-image to get the raw image
{
"code": 0,
"msg": "OK",
"data": {
"complete": true,
"imageToken": "kWbZG...QwWEF",
"feedbackCode": 0,
"feedbackMsg": "OK"
}
}Timeout Example
{
"code": 0,
"msg": "OK",
"data": {
"complete": false
}
}create a new sentry
| Method | Path | Auth |
|---|---|---|
| POST | v1/sentry/create | User |
Request Parameters
| Parameter | Type | Optional | Data Type | Description |
|---|---|---|---|---|
| name | Query String | - | String | Name |
| url | Query String | - | String | The url of the target page |
| x | Query String | - | Integer | X coordinate |
| y | Query String | - | Integer | Y coordinate |
| width | Query String | - | Integer | Area width |
| height | Query String | - | Integer | Area height |
| notification | Query String | - | String | Id of the notification method |
v1/sentry/create?name=Google Doodle&url=https://www.google.com/&x=233&y=164&width=249&height=87¬ification=5b5ad175d1cbcc1dc262a74f
Possible Error Codes
| Error Code | Description | Note |
|---|---|---|
| -2 | Wrong parameter | Wrong protocol (http\https only) |
| -2 | Wrong parameter | - |
| -5 | Record does not exist | notification does not exist |
| -1001 | Area too large | - |
Success Example
{
"code": 0,
"msg": "OK",
"data": {
"sentryId": "5b6f03fbd91333ad6108d2e1"
}
}list all the sentries
| Method | Path | Auth |
|---|---|---|
| POST | v1/sentry/list | User |
Request Parameters
| Parameter | Type | Optional | Data Type | Description |
|---|---|---|---|---|
| - | - | - | - | - |
v1/sentry/list?
Possible Error Codes
| Error Code | Description | Note |
|---|---|---|
| - | - | - |
Success Example
{
"code": 0,
"msg": "OK",
"data": {
"sentries": [
{
"id": "5b66def126b12d6486892931",
"name": "Example Site",
"url": "https://www.example.com/",
"lastCheckTime": "2018-07-28T22:05:22.69+10:00"
},
{
"id": "5b6f03fbd91333ad6108d2e1",
"name": "Google Doodle",
"url": "https://www.google.com/",
"lastCheckTime": "2018-09-13T23:04:02.258+10:00"
}
]
}
}