Skip to main content

Web

A web item embeds a web page on the project map by URL.

Item type: web

Properties

PropertyTypeRequiredUpdatableDefaultDescription
positionobjectNoYes{ x: 0, y: 0 }Position with x and y fields.
sizeobjectNoYes{ width: 1280, height: 768 }Size with width and height fields. Min 5 per dimension.
scalenumberNoYes1Scale factor. Must be > 0.
anglenumberNoYes0Rotation angle (0360).
urlstringYesYesAbsolute URL with http or https scheme.
info

The url must be a valid absolute URL using the http or https scheme. Relative URLs and other schemes are not accepted.

Create

Creates a new web item in the project.

POST /api/v2/projects/{projectId}/item/{parent}/web

curl

curl -X POST "https://api.deon.cloud/api/v2/projects/{projectId}/item/inbox/web" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.example.com",
"position": { "x": 500, "y": 100 },
"size": { "width": 1280, "height": 768 }
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/inbox/web`,
{
method: "POST",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.example.com",
position: { x: 500, y: 100 },
size: { width: 1280, height: 768 },
}),
}
);

const data = await response.json();
console.log(data.itemId);

Response

{
"itemId": "d4e5f6a7-b8c9-0123-defa-234567890123"
}

Update

Updates an existing web item. Only include the properties you want to change.

PATCH /api/v2/projects/{projectId}/item/web/{itemId}

curl

curl -X PATCH "https://api.deon.cloud/api/v2/projects/{projectId}/item/web/{itemId}" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.updated-example.com"
}'

JavaScript

const response = await fetch(
`https://api.deon.cloud/api/v2/projects/${projectId}/item/web/${itemId}`,
{
method: "PATCH",
headers: {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
url: "https://www.updated-example.com",
}),
}
);

const data = await response.json();
console.log(data.itemId);

Response

{
"itemId": "d4e5f6a7-b8c9-0123-defa-234567890123"
}