Skip to main content
caution

This section refers to the old versions of the MonkJs SDK (version 3.X.X and below). For the v4 docs, please refer to this page.

View

npm latest package

yarn add @monkvision/corejs
import monk from '@monkvision/corejs'

const { createOne, deleteOne } = monk.entity.view;

createOne

POST /inspections/${inspectionId}/views

await monk.view.createOne(inspectionId, data);

Try it on api.monk.ai

nametypedefault
inspectionIdstring
dataCreateView
- data.imageIdstring
- data.newImageCreateViewImage
- data.damageIdstring
- data.polygonsnumber[][][]
- data.boundingBoxBoundingBox
{
"axiosResponse": {},
"entities": {
"views": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"imageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"damageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"polygons": [[[0]]],
"boundingBox": {
"xmin": 0,
"ymin": 0,
"width": 0,
"height": 0
},
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}

deleteOne

DELETE /inspections/${inspectionId}/views/${id}

await monk.view.deleteOne(id, inspectionId);

Try it on api.monk.ai

nametypedefault
idstring
inspectionIdstring
{
"axiosResponse": {},
"entities": {
"views": {
"3fa85f64-5717-4562-b3fc-2c963f66afa6": {
"deleted": true,
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"result": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}