ASDinCloudDocs
API ReferenceHTML blocks

HTML blocks

View as Markdown

The HTML block object

View as Markdown

HTML blocks store reusable markup for workspace content.

Attributes

idinteger
Identifier assigned by the API.
namestring
Display name of the HTML block, up to 191 characters.
htmlstring
HTML content of the reusable block.
tscinteger
Creation time as a Unix timestamp in seconds.
tsuinteger
Last update time as a Unix timestamp in seconds.

List HTML blocks

View as Markdown
GET/api/v1/html-blocks

Lists HTML block records in the workspace.

Permissions

Send your API key in X-API-Key. Required permissions are HTML blocks → Read.

Query parameters

qstring
Search by block name.
lengthinteger
Number of records to return.
startinteger
Zero-based offset.
drawstring
Optional request marker echoed in the response.
sortstring
Sort by id, name, tsc, or tsu. Prefix the field name with a minus sign for descending order.
orderstring
Direction for unprefixed sort fields. Use asc or desc.

Returns

Returns records in data, the counts before and after text search, and the echoed draw marker.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.

Retrieve an HTML block

View as Markdown
GET/api/v1/html-blocks/{id}

Returns one HTML block by ID.

Permissions

Send your API key in X-API-Key. Required permissions are HTML blocks → Read.

Path parameters

idintegerRequired
ID of the HTML block.

Returns

The HTML block is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.

Create an HTML block

View as Markdown
POST/api/v1/html-blocks

Creates an HTML block.

Permissions

Send your API key in X-API-Key. Required permissions are HTML blocks → Write.

Body parameters

namestringRequired
Display name of the HTML block, up to 191 characters.
htmlstring
HTML content. Supply either html or body when creating a block.
bodystring
Alias for html. It is used when html is omitted.

Returns

The created HTML block is returned in data.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
422
One or more fields failed validation.

Update an HTML block

View as Markdown
PATCH / PUT / POST/api/v1/html-blocks/{id}

Updates an HTML block by ID.

Permissions

Send your API key in X-API-Key. Required permissions are HTML blocks → Write.

Path parameters

idintegerRequired
ID of the HTML block.

Body parameters

namestring
Display name of the HTML block, up to 191 characters.
htmlstring
HTML content. Supply either html or body when creating a block.
bodystring
Alias for html. It is used when html is omitted.

Returns

Returns a successful update response.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
422
One or more fields failed validation.

Delete an HTML block

View as Markdown
DELETE/api/v1/html-blocks/{id}
POST/api/v1/html-blocks/{id}/delete

Removes an HTML block from the workspace.

Permissions

Send your API key in X-API-Key. Required permissions are HTML blocks → Write.

Path parameters

idintegerRequired
ID of the HTML block.

Returns

Returns a successful removal response.

Errors

401
The API key is missing or invalid.
403
The API key lacks the required permission.
404
The requested record was not found.
400
The block could not be removed.