Listing all block model versions
List all versions of the block model bm_id
using the List version metadata for all versions of a block model endpoint.
Request
Method | Request URL |
---|---|
GET | /orgs/{org_id}/workspaces/{workspace_id}/block-models/{bm_id}/versions |
Query parameters
Query parameter | Description |
---|---|
filter | Optional. Currently only supports the value latest , which will cause the returned list of items to only contain the latest version of the block model bm_id . |
offset | Optional. Integer index of the first item to return. Default value is 0. |
limit | Optional. Maximum number of items to return in the list. Must be greater than 0 and less than or equal to 100. Default value is 50. |
Response
On success, the API will respond with status code 200 OK
and a response body containing the PaginatedResponseWithUnits[Version]
object.
Response body
The PaginatedResponseWithUnits[Version]
object contains the list of versions, as well as metadata pertaining to pagination.
PaginatedResponseWithUnits[Version]
{
"results": list[Version],
"count": int,
"total": int,
"limit": int,
"offset": int
}
Schema field | Description |
---|---|
results | List of versions. Empty if no results can be returned. |
count | The number of block models returned in results . |
total | Total number of versions in the full list without pagination. |
limit | Maximum number of items requested. |
offset | Index of the first item in results with respect to the full list without pagination. |
Example: Getting the latest block model version
To get the latest version of the block model bm_id
which has 15 versions, the following request may be used.
Method | Request URL |
---|---|
GET | /orgs/{org_id}/workspaces/{workspace_id}/block-models/{bm_id}/versions/{version_id}?filter=latest |
The request succeeds and the API responds with the HTTP status code 200 OK
, along with a response body containing the following.
Response body
{
"results": list[Version],
"count": 1,
"total": 15,
"limit": 50,
"offset": 0
}
For an example of listing with pagination in BlockSync, see Listing block models example.